CS 3343/3341
 Analysis of Algorithms 
Fall 2012
  Hidden Resources   


Weird Topics:

  1. Write-Once-Memory. writetwice/writetwice.html
    [Present in class, starting with a brief description and the table. Try to get them to figure it out. Give them access to the page above. Questions in Rec01.]


  2. Fibonacci Search. Truely weird search, See binsearch/fibsearch.html.


  3. Fitting bolts and nuts together. Use partitioning in a way similar to quicksort. See ../bolts/bolts.html


  4. Fake coin weighing problem. Start with n coins, all the same except for one which is lighter than the others. We have a scale which will compare any two piles of coins. Obvious binary division problem, with time bound of log2 n, but not obvious that it is a ternary division problem, with time bound of log3 n. [From Levitin's book. See fakecoin/fakecoin.html.]


  5. Fibonacci Matrices, Part 1. The matrix {{0, 1} {1, 1}} and how powers of it give the Fibonacci numbers: fibmat/fibmat.html
    [Talk about in class. Multiply it a couple of times in class, and have them discover the Fibonacci numbers in powers of the matrix. In a rec, perhaps Rec02, ask them to prove the result by induction. Supply the multiply 2 x 2 matrices code, and ask them to use it to calculate the powers from 1 to 10. Talk about returning a matrix in C, Java, C++. The page to give them about multiplying matrices is: fibmatj/matmul.html.

    Ask them if the matrix {{1, 1} {1, 0}} would work just as well for producing Fibonacci numbers.]


  6. Newton's Method, Part 1. Newton's Method in calculating the square root of 2: [Go over basic idea in class. Have them write a program for it. Have them try initial guesses that lead to bad behavior. Show them that you get double the digits at each iteration. See newton/newtons.html.]


  7. Transmitting half a bit, Part 1. halfbit/halfbit.html
    [Talk about in class, and then give them access to the page. Add a few questions to the current rec. Talk about other cryptographic protocols. Talk about how difficult protocols are, how prone to disaster, how hard to prove correct, and how necessary that is.

    Ask them if one could start with either "not 00" or "not 11" and get also get a protocol that works.]


  8. Balanced Ternary Numbers. [Start by imagining 3-state computer storage: flip-flap-flop instead of flip-flop. Introduce this weird version of base 3 and state some of its amazing properties. See ../ternary/baltern.html.]


  9. Fibonacci Matrices, Part 2. Special formulas come from squares of Fibonacci matrices: See ../fib/fibweird2.html. [Go over the idea in class. Have them use previous code to try selected squares. Have them work on the formula itself for some rec. Really cool formulas fall out.]


  10. Newton's Method, Part 2. Newton's Method for the golden ratio: [Go over basic idea in class. Tell them that the same crazy formulas for Fibonacci numbers will fall out. See newton/fibonacci.html.]


  11. Transmitting half a bit, Part 2. Use of exclusive-or and random numbers. [Go over formulas for xor. Show how to transmit a bit in two stages. Extend to files, to more than two stages. Cryptography in the cold war.]


  12. Exclusive-or and von Neumann's biased coin flip. [Go over formulas for xor. Show how you can get unbiased random numbers from a biased coin.]


  13. Merkle's puzzles. ... as a prelude to public-key cryptography:


  14. Memoization? Fibonacci Numbers? fib/fib.html


  15. Zero knowledge proofs. Specifically proof in zero knowledge that you have a Hamiltonian circuit for a graph:


Exclusive-or:
  1. XOR: ../xor/xor.html


Separate compilation in C:
  1. Multiple File Compilation in C (example from S. Robbins): separate compilation
  2. Side-by-side comparison of previous example in C and Java: comparison: C and Java


Random Number Generators in C:
  1. RNGs: Random Number Generators in C


Problems with Termination:
  1. Simple programs that don't terminate: termination/termination.html


Recursion:
  1. Recursion


Linked Lists:
  1. Java: linked list example ../linked/linked.html
  2. Java: linked list recitation ../linked/linkedrec.html
  3. C: linked list example ../linked/linkedc.html
  4. C: linked list recitation ../linked/linkedrecc.html


Quicksort:
  1. Quicksort algorithm from your text, Java and C side-by-side: quicksort/quicksort.html
  2. Old different Quicksort with timings: quicksort/quicksort_old.html


Test Comparing Binary, Ternary, and Fibonacci Search: With Ternary Search, the idea is to mimic binary search, but divide the array into 3 parts. Then decide which third of the array has the desired element.
  1. Over 170 million searches using 5702887 random doubles in an array: binsearchtest/search.html.


Queue:
  1. Queue, simple, but uses size variable, in Java and C: queue/queue.html
  2. Queue page for Rec. 1: rec1/queue.html


Bubblesort:
  1. Old Bubblesort with timings: bubblesort/bubblesort.html


Strassen's Method:
  1. Strassen's Method for Multiplying Matices: strassen/strassen.html


Heaps, Heapsort, Priority Queue:
  1. Illustrations of actions involving heaps: heap/heaps.html
  2. Heapsort implemented: heap/heapsorttest.html
  3. Priority queue implemented using heaps: heap/pqueuetest.html


Greedy Algorithms:
  1. Roman Numberal conversions: ../greedy/roman.html


Binary trees:
  1. Binary search tree of doubles, in Java: search tree
  2. Sorts of doubles: treesort, bubblesort, quicksort, in Java: sorts and timing
  3. Binary Trees: Traversals and Drawing: here
  4. Binary Search Tree and Test, in C: here
  5. Random Binary Searc Trees: Depth of Nodes, in C: here


Graph Algorithms (Java):
  1. Simple graph construction prototype, in Java: graphsimpler/graph.html
  2. Same as previous, but with breadth-first search, in Java: graphbreadth/graph.html
  3. Graph construction using named nodes with locations, in Java: graph/graph.html
  4. Graph construction using named nodes with locations, applet gives graph diagram, in Java graphapp/graphapp.html
  5. Pictures of breadth-first search, in Java: graphbreadth4/graphapp.html
  6. Pictures of depth-first search, in Java: graphdepth4/graphapp.html


Graph Algorithms (C):
  1. Simple graph construction prototype, in C: graphc/graph.html
  2. Breadth-first search, in C: graphcbreadth/graphcbreadth.html


Turing machines:
  1. Turing machines: ../turing/turing.html
  2. Interpreter: ../turing/interp.html


Special symbols in HTML:
  1. Special symbols in HTML: ../special_symbols.html


Latex for illustrations:
  1. Latex: ../latex/fib.pdf


Pictures of Students:
  1. Pictures (password protected, use "CS3343" for "User Name").


Organization:
  1. Assessment: here
  2. Core Skills: here
  3. Core Syllabi: here


Revision date: 2011-10-27. (Please use ISO 8601, the International Standard Date and Time Notation.)