Level Paper 1 Exam With
Corrct Answers
what is post-fix used for? - ✔✔✔ANSWER-for infix to reverse polish notation
conversions, infix to postfix.
What is pre-order traversal used for? - ✔✔✔ANSWER-copying a tree.
What is selection? - ✔✔✔ANSWER-comparing values and then choosing an
appropriate action. e.g. an if statement.
,what is the design principle encapsulate what varies? - ✔✔✔ANSWER-
requirements likely to change are encapsulated in a class. future changes are easily
made.
advantages of using an adjacency matrix to represent a graph? - ✔✔✔ANSWER-it
is more time efficient when looking if a particular edge as it can be looked up via
its row and column.
advantages to using an adjacency list compared to an adjacency matrix to represent
a graph. - ✔✔✔ANSWER-it's more memory efficient as it only stores edges that
exist in the graph.
advantages to using an adjacency matrix compared to an adjacency list to represent
a graph. - ✔✔✔ANSWER-it's more time efficient as it allows specific edges to be
queried easily via looking up its row and column.
an example of what graphs can be used to represent in computing. -
✔✔✔ANSWER-networks, IT networks e.g. the internet.
an example of where queues are used in computer systems? - ✔✔✔ANSWER-
keyboard buffers, each key press is added to the queue.
an example where you would use depth first traversal? - ✔✔✔ANSWER-
navigating a maze.
benefits of programming in oop? - ✔✔✔ANSWER-clear structure to the program
developing and testing is easier
, team projects are easier
classes can be reused
space efficient.
disadvantages to using an adjacency list compared to an adjacency matrix to
represent a graph. - ✔✔✔ANSWER-it's slow to query as you must search the list
sequentially to find a specific edge.
disadvantages to using an adjacency matrix compared to an adjacency list to
represent a graph. - ✔✔✔ANSWER-it takes up more memory as it stores edges
that don't exist and half the data is repeated.
example of a priority queue? - ✔✔✔ANSWER-in a school a headmaster will have
a higher printer priority than the students so their print jobs are completed first.
how are values looked up in a hashing table? - ✔✔✔ANSWER-the desired value is
inputted and hashed and the position in the table corresponding to that hash is
queried.
how do well designed hash tables get around collisions? - ✔✔✔ANSWER-by
using rehashing which finds an available position according to an agreed
procedure.
how do you complete vector addition? - ✔✔✔ANSWER-add the corresponding
vectors together.
how do you scale a vector? - ✔✔✔ANSWER-each of its components are
multiplied by a scalar