20-CS-122-001 Computer Science II Spring 2012
Recursion

Virtual functions, classes, inheritance, lists, queues, stacks, applications

Code Description
factorial Elementary factorial function, recursively defined
tail recursive factorial Factorial function with accumulator to avoid stacking
tail recursive factorial Factorial function with static accumulator
fibonacci numbers Elementary fibonacci number generator
tail recursive fibonacci Fibonacci generator with accumulator
tail recursive fibonacci Fibonacci generator with static accumulator
maximum number in list Find the maximum number in a list
tail recursive findmax Find maximum number using tail recursion
tail recursive findmax Find maximum number using tail recursion and static accumulator
quicksort Sort a given array of integers
topological sort Create a total ordering consistent with a given partial ordering
partition problem Find a subset of numbers exactly summing to given number B
partition problem Solution using the tabular method

Power Point
topological sort Illustrates flow of control in recursive topological sort given above
quicksort Illustrates partitioning around a pivot
quicksort alternate Illustrates alternative partitioning around a pivot
partition Various dynamic programming solutions to recusively specified problems
raising x to power y Use of stacks to solve this problem