CS 411 Fall 2025  >  Assignment 4 (Various)


CS 411 Fall 2025
Assignment 4 (Various)

Assignment 4 is due at 5 pm Tuesday, October 28. It is worth 85 points.

Procedures

This assignment is to be done individually.

Turn in your answers to the exercises below on the UA Canvas site, under Assignment 4 for this class.

Exercises (A–J, 85 pts total)

Do each of the following exercises. “L 2.4/9” means section 2.4 in the Levitin text, exercise #9.

  1. L 2.4/9.
    Be sure to show your recurrence and its exact solution.
  2. L 3.2/8.
    “Design an algorithm” means that I want a precise enough description that I could write code based on it. (You may suppose that I am a reasonably competent programmer.)
  3. L 4.5/13.
    Be careful with this one! Whatever algorithm you come up with, I strongly suggest that you try it out on some actual data. In particular, you should construct a sizable matrix that meets the required conditions, and in which the value being searched for occurs exactly once, somewhere in the middle of the matrix. Does your algorithm find it? And is it really \(O(n)\)?
  4. L 5.1/5.
  5. L 5.3/5.
    In each part, give a list of the values in the order they will be visited.
  6. L 6.1/8.
  7. L 6.6/6.
  8. L 7.1/7.
    In part b, describe an algorithm.
  9. L 7.1/10.
  10. L 7.3/3.