BACK

Algorithm Analysis,
Recurrence and Recursion

NEXT

DumbSort.java Counter-example:  it is not sufficient that the algorithm generates the desired output.  [Text version]
DumbSort.rtf    Class hand-out:  above code as two-column text

Recursion review:  Binomial Coefficient Recursion:  The Good, and The Bad and Ugly (as Word-97 document)
HTML version.

Selection.txt      In-class example:  selection sort.  Word-processor file for slides:  Recursion_Slides.rtf
RecurSort.html  Slide for recursive insertion sort and selection sort and link to tail recursion slide
ArraySort.java  Full Java file including the selection sort (along with recursive insertion sort)

Hanoi.java         Source code for simple Towers of Hanoi program
Hanoi.exe          Executable of nearly equivalent C code
HanoiBAS.exe  Animated Towers of Hanoi program   [HanoiBAS.bas, if you want to see the QuickBasic source]

Qrecurr.xls        Excel spreadsheet with the Q(N) recurrence
Paper regarding binary search (why Q(N) is possibly of interest):  Analytic Derivation of Comparisons in Binary Search, SIGNUM Newsletter, Vol. 32, No. 4 (Oct 1997), pp. 15-19.  Word processor (RTF) version.

InductionExamples.html   Several specimen induction proofs for summations
SigmaCoeff.doc              Sum of binomial coefficients example
SigmaCoef.html               Same in HTML format
Kth_Smallest.html           Analytic proof of the "best-" and worst-case behaviors for finding the Kth smallest element using QuickSort's Partition method.
n_log_n.html                   Analytic proof of the n log2(n) behavior of MergeSort and the optimal QuickSort.


Enrichment Material (not subject to examination)

Recursive Descent   Extended example from compilers:  recursive descent parsing of expressions

FibSheet.html    Hanoi recurrence and Fibonacci recurrence (cf. Appendix D, Example 5) — Spreadsheet experimentation
FibSheet.doc     Same information in Word 6.0/95 format
FibSheet.xls      Supporting spreadsheet — the actual spreadsheet experimentation.

Hanoi-NR.cpp  NON-recursive implementation in Borland C++ — uses screen positioning specific to Borland C++
Hanoi-NR.exe  Executable from Borland C++
Hanoi_NR.bas  Implementation in QuickBasic / QBasic
Hanoi_NR.exe  Executable from QuickBasic