Assignment 7: Binary Search Tree

This week we were to implement a binary search tree, along with iterative and recursive traversals.

I tested the traversals on randomly generated trees of 10, 100, 1000, 10,000, 100,000, and 1,000,000 elements.  I also compared these results with the results of Quick Sort from a previous assignment.  The following charts show my results.



Quick Sort seemed to be slightly slower, but much steadier in the long run.

Looking more closely at the difference between the iterative and recursive tree traversals:


The recursive traversal was a little faster (and much easier to code).  However once the inputs got larger it slowed WAY down.




Home