midterm2-2010f

# An algorithm that solves the halting problem in on2

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: h 8th 6. 4 pts [Algs/Cplxty] For each of the following, select one of the following: (i) Already exists, (ii) Cannot exist, or (iii) Could exist, but would be remarkable. a. An algorithm that solves an NP ­complete problem in O(n2) steps b. An algorithm that solves the halting problem in O(n2) steps c. An algorithm that sorts n numbers in O(n2) steps d. An algorithm that colors a graph with the fewest colors in O(n2) steps 7. 6 pts [Algs/Cplxty] a. True or False? n2 log n + .5n3 + (log n4) is O(n3). b. True or False? 2n+3n+n100 is O(n100) c. True or False? The efficiency of an algorithm can depend on how the data is stored. d. True or False? The “Big ­O” O() of an algorithm tells us how long it takes in microseconds. e. True or False? The “Big ­O” O() of an algorithm tells us roughly how many steps it will take as the input grows f. True or False? Breadth ­first search can be done in O(log n) time 8. 6 pts [Graph coloring] A school is scheduling informational sessions for parents to learn about their children’s classes. Each class will have one session for parents to go to. Parents need to go to sessions for each of their child’s classes. Thus, if a parent has a child taking both algebra and history, then the algebra and history sessions cannot be scheduled at the same time. Describe how to model this as a graph coloring problem. In particular: a. What are the vertices of the graph that represent this problem? b. What are the edges of the graph? c. If two vertices are colored the same color, what will this mean? d. If two vertices are colored different colors, what will this mean?...
View Full Document

Ask a homework question - tutors are online