Comp 271-400 Week 4
Lewis Tower 410, 4:15-8:15 Nov 13
Bailey chapter 6, on sorting
Bailey chapter 9, on lists (and, in particular, linked
Bailey chapter 15.4.2: (chained) hashing
Morin chapter 1, sections 1.1 and 1.2
One slight peculiarity of Morin is
that he refers to the array-based List implementation of chapter 2 as an
Primary text: Bailey, online, and maybe Morin, also online.
Information about MSDNAA is in the Intro to C++
There's an algorithmic reason why quicksort's speed is affected by whether
the data is already sorted: if we pick data[left] as the pivot in a sorted
array, we'll partition into an empty left half and a right half of size N-1.
But why should mergesort be faster if the data is already sorted?
The algorithm executes exactly the same steps!
121 213 122
211 321 132 223
Naive approach: bucketize on the first digit, then sort the buckets
1337 approach: bucketize on the last digit, concatenate, bucketize on
second-to-last digit, concatenate, bucketize on the first digit
insertion and search
Lab 4: tree-based dictionary
Recursion starts at Bailey page 94
- Framework: parsing statements plus syntax-directed actions.