COS 226 Final: COS 226 Princeton Final Fall 09

22 views14 pages

Document Summary

This test has 12 questions worth a total of 100 points. The exam is closed book, except that you are allowed to use a one page cheatsheet (8. 5-by-11, both sides, in your own handwriting). No calculators or other electronic devices are permitted. Give your answers and show your work in the space provided. Write out and sign the honor code pledge before turning in the test. I pledge my honor that i have not violated the honor code during this examination. Printing the keys in a binary search tree in ascending order. Finding a minimum spanning tree in a weighted graph. Finding all vertices reachable from a given source vertex in a graph. Checking whether a digraph has a directed cycle. Building the knuth-morris-pratt dfa for a given string. Sorting an array of strings, accessing the data solely via calls to charat(). Sorting an array of strings, accessing the data solely via calls to compareto().