Experimenting with Sorting and Searching

  1. There are many ways to improve your command of sorting and searching procedures. You should by now be adept at 'ringing the changes' on demonstration programs.
    • If the demonstration uses a file, try it with an array of records and vice-versa.
    • If the demonstration is a list of simple types such as integers, try it with another type such as string and/or with an array of records.
  2. You could experiment to see which sorting routines are stable. (How do they cope with duplicate values). You could then adapt the searches to output all of the records with duplicate key fields.
  3. Try your own algorithms for hashing strings of common words and test the number of collisions they produce.
  4. Produce data sets that expose the deficiencies of different searching and sorting methods.
  5. Research other sorting methods such as the merge sort and radix sort and write Pascal procedures to implement them.
Programming - a skill for life!

Quicksort, bubble, insertion and tree sort, binary search tree and linear, binary and hash search