quiz4 - Quiz 4 CS 2110 April 7 Name: NetId: The first...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Quiz 4 CS 2110 April 7 Name: NetId: The first 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 Breadth-First 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 first, 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 Depth-First 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 first, 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 worst-case 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).

Ask a homework question - tutors are online