This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Quiz 4
CS 2110
April 7
Name:
NetId:
The ﬁrst three questions will refer to the following graph: 1. Is the alphabetical ordering of the nodes in the graph above consistent with a topological
sort of the graph?
(a) Yes.
(b) No.
(c) This is not Directed Acyclic Graph (DAG), so the question does not make
sense.
(d) Yes, but only on a full moon.
2. In which order will BreadthFirst Search (BFS) starting at node A visit the nodes in the
graph above? In case of ties, assume that BFS explores nodes closer towards the front of
the alphabet ﬁrst, and that it never visits a node more than once.
(a)
(b)
(c)
(d) A→B→C→D→E→F
A→D→F →C→E→B
A→B→D→F →C→E
A→B→C→D→F →E 3. In which order will DepthFirst Search (DFS) starting at node A visit the nodes in the
graph above? In case of ties, assume that DFS explores nodes closer towards the front of
the alphabet ﬁrst, and that it never visits a node more than once.
(a)
(b)
(c)
(d) A→B→C→D→E→F
A→D→F →C→E→B
A→B→D→F →C→E
A→B→C→D→F →E 4. Select the statement that is true.
(a)
(b)
(c)
(d) A Queue is a FIFO data structure and a Stack is a LIFO data structure.
You cannot implement a Queue using two Stacks.
HeapSort’s worstcase time complexity is O(n2 ).
A Priority Queue is usually implemented using a Linked List. 1 ...
View
Full
Document
This note was uploaded on 09/17/2011 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell University (Engineering School).
 Spring '07
 FRANCIS
 Sort

Click to edit the document details