INTRO TO ALGORITHMS, COMP 160, ASSIGNMENT 1 with solutions
Due Thursday Sept.19
This assignment is worth 2% of the nal grade.
1. We saw that two sorted arrays of elements, of size n and m, can be
merged in O(n+m) time. Specically, a merge involved a cer
INTRO TO ALGORITHMS, COMP 160, HOMEWORK 6
Deadline: see homework html page.
Worth 2% of the nal grade. Covers lectures 11 and 12.
Groups: (1+2), 3. Write your name on every sheet of paper.
1. (Augmenting a skip list; 10 points) You are given a list of
INTRO TO ALGORITHMS, COMP 160, HOMEWORK 5
Worth 2% of the nal grade.
1. Repeat part 2 of the analysis of random BST height, without using Yn
instead of Xn . In other words, compute E [Xn ] directly. You may have
to do a couple steps in a dierent way than
INTRO TO ALGORITHMS, COMP 160, HOMEWORK 4
Worth 2% of the nal grade.
Covers lectures 7 and 8.
1. We saw how to compute the median of n elements deterministically in
linear time, using groups of 5. Show what happens if we form groups
of 3 instead. Descri
INTRO TO ALGORITHMS, COMP 160, HOMEWORK 3
Due Wednesday Oct.2, before class (by email, or hand in on desk)
Worth 2% of the nal grade.
Covers lectures 5 and 6.
Questions 1-2, 3-4, 5-6 can be grouped onto 3 separate sheets.
Questions 1, 4 and 6 have sh
INTRO TO ALGORITHMS, COMP 160, HOMEWORK 2
Due Wednesday Sept.25, before class (by email, or hand in on desk)
Worth 2% of the nal grade.
Covers lectures 3 and 4.
1. Provide an upper bound on the time complexity of Quicksort assuming an alternating seque