finmock1

B in a digraph in which every vertex has exactly one

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
(b) In a digraph in which every vertex has exactly one in-edge and exactly one out-edge the number of edges equals the number of vertices, true or false? (c) A binary search tree that has the red-black tree balance property is an AVL tree, true or false? (d) A min-heap contains the keys 1 , 2 ,..., 127. The height of the heap is 6, true or false? (e) In a simple graph with n vertices the number of simple paths of length 2 is O ( n 3 ), true or false? 3. (15 points) Prove that if f ( n ) is O ( n ) and g ( n ) is Ω( n ) then f ( n ) is O ( g ( n )). You cannot use any of the theorems stated in the lecture notes, the textbook, or the lab notes. Your proof should rely only on the definition of Big-Oh. 4. (20 pts) Consider the following graph G with vertices 1 , 2 , 3 , 4 , 5 , 6 and edges 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-6, 4-5, 5-6 (a) Suppose we run the breadth-first search algorithm on G , starting at node 1 and such that the algorithm explores the edges incident to a node in the numerical order of the labels of the node at the other end. What cross edges does the algorithm find? (b) Draw the spanning tree of discovery edges produced by the algorithm stated in (a). (c) For the same graph
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

Page1 / 3

b In a digraph in which every vertex has exactly one in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online