Part II: Multiple Choice Questions: (1 pts each)
(Take the multiple–choice questions online from LiveLab
before midnight today. Log in and click Take Instructor
Assigned Quiz Quiz2. You have to take it before it is due.
You have to submit it within 20 minutes.)
1. The ________ is to visit the left subtree of the current node first, then the current node itself, and finally the right
subtree of the current node.
a. postorder traversal
b. preorder traversal
c. inorder traversal
d. breadth-first traversal
#
2. The time complexity for finding an element in a binary search tree is _________.
a. O(logn)
b. O(nlogn)
c. O(n)
d. O(1)
#
3. To add a new node, you need to start a process by first placing it as _______ and move it up to maintain the heap
property.
a. the last node in the heap
#
4. The time complexity of the DFS algorithm is O(|E| + |V|).
a. true
b. false
#
5. A ____ is an edge that links a vertex to itself.
a. loop
b. parallel edge
c. weighted edge
d. directed edge
#
6. If two vertices are connected by two or more edges, these edges are called ______.
a. loop
b. parallel edge
c. weighted edge
d. directed edge
#
7. A _________ is the one in which every two pairs of vertices are connected.
#
8. A graph may have several minimum spanning tree.
a. true