This preview shows page 1. Sign up to view the full content.
Unformatted text preview: tiplication algorithm.
Solution: False. Problem Set 5 has shown that the O(N 2 ) algorithm runs faster
for small numbers.
(d) T F [2 points] If we convert an ndigit base256 number into base 2, the resulting
number of digits is Θ(n2 ).
log n
Solution: False. log256 n = log 2256 = log82 n . By converting a base256 number
2
to base 2, the number of digits is multiplied by 8. For all b1 , b2 = 1, converting
a baseb1 number to baseb2 results in a linear increase or decrease in the number
of digits. (e) T F [2 points] In a weighted undirected graph G = (V, E, w), breadthﬁrst search
from a vertex s ﬁnds singlesource shortest paths from s (via parent pointers) in
O(V + E ) time.
Solution: False. Only in unweighted graphs. (f) T F [2 points] In a weighted undirected tree G = (V, E, w), breadthﬁrst search
from a vertex s ﬁnds singlesource shortest paths from s (via parent pointers) in
O(V + E ) time. 6.006 Quiz 2 Solutions Name Solution: True. In a tree, there is only one path between two vertices,...
View
Full
Document
This document was uploaded on 03/17/2014 for the course ELECTRICAL 6.006 at MIT.
 Fall '11
 ErikDemaine

Click to edit the document details