mid-prac - Fall 2011 Clyde Kruskal CMSC 351 Practice...

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

View Full Document Right Arrow Icon
Fall 2011 Clyde Kruskal CMSC 351: Practice Questions for Midterm Exam These are practice problems for the upcoming midterm exam. You will be given a sheet of notes for the exam. Also, go over your homework assignments. Warning: This does not necessarily re±ect the length, di²culty, or coverage of the actual exam. Problem 1. (a) What is the best-case number of moves in Insertion Sort? Justify. (b) What is the worst-case number of moves in Insertion Sort? Justify. (c) What is the average-case number of moves in Insertion Sort? Justify. Problem 2. (a) Is 2 n +1 = O (2 n )? (a) Is 2 2 n = O (2 n )? Problem 3. Use the iteration method to solve the following recurrences. You may assume n is “nice”. Prove you answers using mathematical induction. (a) T ( n ) = 2 T ( n/ 2) + n 3 , T (1) = 1. (b) T ( n ) = T ( n ) + 1, T (2) = 1. (c) T ( n ) = 2 T ( n/ 2) + n lg n , T (1) = 1. (d) T ( n ) = T ( n - 3) + 5, T (1) = 2. Problem 4.
Background image of page 1

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

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

This note was uploaded on 01/13/2012 for the course CMSC 351 taught by Professor Staff during the Fall '11 term at University of Louisville.

Page1 / 2

mid-prac - Fall 2011 Clyde Kruskal CMSC 351 Practice...

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