American Computer Science League
Contest #4

Contest #4 Schedule
30 Minute TestFriday11 April 2008
Take Home ProblemFriday4 April 2008
Return ProblemMonday7 April 2008

Topics To Master For Contest #4

  1. ACSL Handout:   Data Structures

  2. Interactive Data Structure Visualizations is an incredible web site that adds visualization to various data structures.

    • Under "Binary Trees", click on Transversals.

    • Read about the different ways that you can traverse a binary tree.

      1. Preorder (Prefix): A preorder binary tree traversal uses the order DLR, data--extracting the data, left and then right.

      2. Inorder (Infix): A inorder binary tree traversal uses the order LDR, left, data--extracting the data, and then right.

      3. Postorder (Postfix): A postorder binary tree traversal uses the order LRD, first left, then right, then data--extracting the data.

    • Clicking on the "Explanation" button in the lower left corner of the web page displays the source code in the Ada computer programming language of the different traversals of a binary tree. (See below for Java source code.)

    • Click the "Start Visualization" button to play an Ada applet where you can examine how to search for a node in a binary tree by using one of several diffent search patterns == search the tree in one of several different "orders".

      A binary search tree is a binary tree each of whose nodes contains a value that is greater than all the values in the nodes in its left subtree and less than all the values in the nodes in its right subtree. It is knowledge that the tree was built in this sequence that makes it possible to use a binary search to find a specific node in the tree.

    • You cannot close the applet by clicking the "X" close button in the top right corner. Instead, you must click the "Stop Visualization" button in the bottom right corner of the web page itself.

    • Under "Binary Trees", clock on Search Trees.

    • Read about the advantages of a Binary Search Tree.

    • Click the "Start Visualization" button to play an Ada applet where you can examine the three Fundamental Operations of a Binary Search Tree.

      1. Insert

      2. Delete

      3. Find

    • Clicking on the "Explanation" button in the lower left corner of the web page displays the source in the Ada computer programming language of the fundamental operations of a binary search tree. (See below for Java source code.)

    • You cannot close the applet by clicking the "X" close button in the top right corner. Instead, you must click the "Stop Visualization" button in the bottom right corner of the web page itself.

  3. Java Source Code for a non-recursive binary search tree (Horstmann's Big Java, 2nd Ed, pp 803-807)

  4. In a trilogy of extraordinary books (third not yet published), Robert Sedgewick has written what many believe to be the definititve treatment of algorithms. Volume I in four parts of that trilogy was originally published using the Pascal programming language and later C++ and Java. That volume covered fundamental concepts, data structures, sorting algorithms, and searching algorithms. Then came Volume II covering graphs and graph algorithms available in three languages: Pascal, C++ and Java. The third volume has not yet been published in any language, but reportedly will cover strings, computational geometry and advanced algorithms and applications.

    Algorithms for working with Binary Search Trees are comprehensively addressed in Sedgewick's Algorithms in Java, 3rd Edition, Volume I, pages 531-554)

    Robert Sedgewick and Kevin Wayne together published what may well be the best introductory computer science book yet written:   Introduction to Programming in Java. An excerpt from an early draft of that book that was posted on Sedgewick's web site discussed the binary search tree as a recursive structure. (pp 619-631)


URL:   http://www.comscigate.com/    Last Revised:  April 5, 2008