Click to See Complete Forum and Search --> : Binary Search Tree Question!


The_Lone_Wolf
December 13th, 2005, 05:39 AM
I am doing a question on binary search tree. its doesn't involve coding but diagrams. I have found a website which talks about this and was just wondering if this was correct and that i am looking at the right information. If it is correct i can use it as an example and then do the below question!


Question

Explain, with the aid of diagrams, the effect of making the following insertions into an initially empty BST tree in the order given: 19, 4, 25, 1, 13, 16, 9, 14, 7, 21, 18, 28. Show the order in which the numbers would be visited for a depth-first and breadth-first traversals of the final BST tree.

Link
http://www.cis.upenn.edu/~matuszek/cit594-2005/Lectures/28-tree-searching.ppt#268,1,Tree Searching

pages 3 and 6

krishnavenit
December 22nd, 2005, 02:15 AM
Dfs 19,4,1,13,9,7,14,16,18,25,21,28
Bfs 19,4,25,1,13,21,28,9,16,7,14,18