University of Nevada Las Vegas
Howard R. Hughes College of Engineering
Department of Computer Science
My Home Page

Computer Science 477/677
Analysis of Algorithms
Fall 2013
Assignments

Revised December 17, 2013

Background.
It is important to have a good background in algorithms and data structures at the level of CSC 302.
There is background material in your textbook.
Wednesday September 4, 2013.
Turn in Assignment 1 at the beginning of class today.
Wednesday September 11, 2013.
Turn in Assignment 2 at the beginning of class today.
The lecture topic today will be sorting. A major part of the examination on Monday will be on that subject.
  1. Lower Bound on Sorting in the Comparison Model of Computation.
  2. Sorting algorithms we will go over:
    1. Selection sort.
    2. Insertion sort.
    3. Bubblesort.
    4. Mergesort.
    5. Quicksort.
    6. Polyphase mergesort.
    7. Binary tree sort, which is actually a fast implentation of insertion sort.
    8. Heapsort, which actually a fast implementation of selection sort.
    9. Shell sort, named after Donald Shell. Very ancient. Hardly anyone understands it. Donald Shell probably didn't, since he implemented it in the worst of all possible ways.
    10. Radix or bucket sort, the only sorting algorithm in this list which does not use the comparison model of computation.
  3. When I (personally) need to write a sorting algorithm in a program, I usually pick one of my four favorites. Which do you think they are?
Monday September 16, 2013.
Examination today.
Practice examination in postscript format.
Practice examination in portable document format.
Highest score: 180
75 percentile score: 155
Median score: 135
25 percentile score: 120
Mean score: 138
Wednesday September 25, 2013.
Turn in Assignment 3 at the beginning of class today.
Wednesday October 2, 2013.
Turn in Assignment 4 at the beginning of class today.
Wednesday October 9, 2013.
Turn in Assignment 5 at the beginning of class today.
Additional examples added to help you check your work.
Solution to the monotone subsequence problem
Monday October 14, 2013.
Examination today.
Some problems
Highest score: 215
75 percentile score: 165
Median score: 130
25 percentile score: 110
Mean score: 139
Wednesday October 16, 2013.
The examination is not yet graded. I came to the realization that my first linear time solution to problem 7. (maximum weight independent subsequence) is incorrect. At least one of the students gave a correct, but quadratic time, solution.
I changed my solution so that is both correct and linear time. Fortunately, that solution, together with my solution to the second problem of Assignment 5, lead directly to the next topic, namely range queries.
Wednesday October 23, 2013.
Turn in Assignment 6 at the beginning of class today.
Assignment 6 is canceled.
Wednesday October 30, 2013.
Turn in Assignment 7 at the beginning of class today.
The handout has been updated.
Postscript format.
Let there be no confusion: pages 4 and 5 of the handout are not part of Assignment 7.
Monday November 4, 2013.
Memoization, a top-down form of dynamic programming.
Wednesday November 6, 2013.
Turn in Assignment 8 at the beginning of class today.
The stable marriage problem. An application: assigning interns to hospitals.
(I first heard of an algorithm to solve the intern/hospital assignment problem in 1952 or 1953, from Peter Franken. When I asked Peter how it was done, he only told me that the computer first matched first choices. I then forgot about the problem for the next thirty years.) The stable roommate problem is unsolvable.
Graham Scan. We use amortized analysis to prove that it takes O(n log n) time.
Divide and Conquer algorithm for finding the closest pair out of a finite set of points in the plane.
The Traveler's problem.
Wednesday November 13, 2013.
Examination today.
Practice examination in postscript format.
Updated Tue Nov 12 14:43:30 PST 2013
Practice examination in portable document format.
There will also be a problem in dynamic programming.
Answer to Question 7
Highest score: 235
75 percentile score: 190
Median score: 150
25 percentile score: 115
Mean score: 149
Wednesday, November 20, 2013.
  • Using neighbor lists to topologically sort an acyclic directed graph in O(m) time.
  • Closest pair of points in a plane.
  • Balanced search structures.
    1. Treap: a randomized search structure, which is balanced in the Las Vegas sense.
      What is the meaning of the phrase "Las Vegas time complexity"?
      What is the difference between a Las Vegas algorithm and a Monte Carlo algorithm?
    2. Red black tree, which is deterministically balanced.
    3. 2-3 tree, which is deterministically balanced.
  • Monday, November 25, 2013.
  • Semigroups.
    1. Range queries.
    2. Applications in minimum path finding.
    3. Application to adding two n-digit numerals in O(log n) time with n/log n processors.
  • Multi-core Computing.
    1. Minding a maximum, minimum, or sum of n values in O(log n) time with n processors. Can you do it with fewer processors?
    2. Adding two n-digit numerals in O(log n) time with n/log n processors.
    3. Can the Boolean circuit problem be solved efficiently with a multi-core computer?
  • Wednesday, November 27, 2013.
    Turn in Assignment 9 at the beginning of class today.
    Wednesday, December 5, 2013.
    Wednesday, December 11, 2013.
    Final Examination. The final examination is scheduled for 3:10 - 5:10 PM. The examination will be comprehensive.
    Practice final in postscript form
    Practice final in pdf form
    Topics to study in preparation for the final exam.
    There may be questions on some of these topics that are not represented on the practice final.
    Tuesday, December 17, 2013.
    I have submitted the grades, finally.

    Back to Course Page