{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

pract-fin

# pract-fin - CMSC 451:Fall 2011 Clyde Kruskal Practice...

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

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

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

Unformatted text preview: CMSC 451:Fall 2011 Clyde Kruskal Practice Problems for the Final Exam Disclaimer: These are practice problems for the upcoming final exam. This does NOT reflect the length, difficulty, or coverage of the actual exam. Problem 1. Consider a mergesort-like algorithm that splits a list into three equal sized lists, recursively sorts each list, and merges the three lists into a single sorted list. You may assume that the original list size is a “nice” number. (a) How fast can you merge the three lists? Count the number of comparisons exactly. (b) Write a recurrence for the number of comparisons your algorithm uses. (c) Solve the recurrence. You may use the “master theorem”. (d) How does this algorithm compare to standard merge sort? Problem 2. Assume that two teams A and B are playing a tournament where the first team that wins n individual games wins the tournament. Team A has probability p of winning each game (so Team B has probability 1 − p of winning each game). At any given point in the tournament Team A has j games left to win, and Team B has k games left to win....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

pract-fin - CMSC 451:Fall 2011 Clyde Kruskal Practice...

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

View Full Document
Ask a homework question - tutors are online