COSC 2436 Exam 2 Questions and
Answers5
Which hashing method prevents two nearby clusters from (logically) merging into a single big
one: - ANSWERS-coalesced chaining
Why not always use binary search instead of hashing? - ANSWERS-because data has to always
be sorted for binary search to work
A good example of time-space compromise is a size of array used to store: - ANSWERS-hash
table size
In a circular doubly linked list, let's assume that the last node is pointed to by last_pt. If so, the
following is true: - ANSWERS-last_pt^.link_pt^.content = = head_pt^.content
head_pt^.back_link^. content == last_pt^.content
=> both a and b
Assume that in a linked list temp_pt is pointing to a node. We can change the temp_pt (e.g. use
it for another purpose) only if: - ANSWERS-there is another accessible pointer pointing to the
node in question
Changing the graph ___________ will increase the size of adjacency matrix - ANSWERS-from
directed to undirected
Default (most visually obvious) Google map graph weight is: - ANSWERS-distance
, In an un-weighted graph connections can be most efficiently represented by _________type -
ANSWERS-boolean
How many nodes are there in a graph represented by a 3x3 adjacency matrix? - ANSWERS-3
Which of the following is true?
worst case time of Heapsort is better than worst cast time of Quicksort
average case time of Quicksort is better than average case time of Heapsort
best case time of Quicksort is worse that best case time of Heapsort
both a) and b) - ANSWERS-worst case time of Heapsort is better than worst cast time of
Quicksort
In array representation of Heapsort, the parent of h[31] will be located at: - ANSWERS-h[15]
Invalid heap:
K
/\
MS
Answers5
Which hashing method prevents two nearby clusters from (logically) merging into a single big
one: - ANSWERS-coalesced chaining
Why not always use binary search instead of hashing? - ANSWERS-because data has to always
be sorted for binary search to work
A good example of time-space compromise is a size of array used to store: - ANSWERS-hash
table size
In a circular doubly linked list, let's assume that the last node is pointed to by last_pt. If so, the
following is true: - ANSWERS-last_pt^.link_pt^.content = = head_pt^.content
head_pt^.back_link^. content == last_pt^.content
=> both a and b
Assume that in a linked list temp_pt is pointing to a node. We can change the temp_pt (e.g. use
it for another purpose) only if: - ANSWERS-there is another accessible pointer pointing to the
node in question
Changing the graph ___________ will increase the size of adjacency matrix - ANSWERS-from
directed to undirected
Default (most visually obvious) Google map graph weight is: - ANSWERS-distance
, In an un-weighted graph connections can be most efficiently represented by _________type -
ANSWERS-boolean
How many nodes are there in a graph represented by a 3x3 adjacency matrix? - ANSWERS-3
Which of the following is true?
worst case time of Heapsort is better than worst cast time of Quicksort
average case time of Quicksort is better than average case time of Heapsort
best case time of Quicksort is worse that best case time of Heapsort
both a) and b) - ANSWERS-worst case time of Heapsort is better than worst cast time of
Quicksort
In array representation of Heapsort, the parent of h[31] will be located at: - ANSWERS-h[15]
Invalid heap:
K
/\
MS