Data Structures and Algorithms

Workshop 2


  1. Download and save into your directory from the download window:
    1. binsearch.c
  2. Copy your original collection.c to collection_bs.c and replace FindInCollection with the binary search version.
  3. Modify AddToCollection to insert new items in sorted order.
  4. Time add and find operations and verify that you have the expected behaviour of the time vs n plot.
  5. Compare the absolute times with those obtained for add and find operations in the previous workshop.

Submit the assignment using the same procedure as before.

Workshop 3 & 4
Table of Contents
© John Morris, 1996