Results 1 to 8 of 8
- 04-11-2012, 07:31 PM #1
Senior Member
- Join Date
- Oct 2011
- Posts
- 115
- Rep Power
- 0
Binary Search Tree (traversals) Question
Here is the question:
1.)Draw the tree that would be formed by inserting the words in this question into a binary search tree. Use lowercase letters.
Here's what I have:
Binary search tree with 22 words will have only 20 words as the and tree are repeated...I believe this is correct
2.) Show all three traversals of this tree.
Inorder:
a binary by be draw formed in letters lowercase into question search inserting that the this tree use words would
Preorder:
draw be a by binary the that formed inserting in question into lowercase letters search tree this would words use
Postorder:
a binary by be formed in letters lowercase into search question inserting that this use words would tree the draw
or
draw the tree would words use this that formed inserting question search into lowercase letters be by binary a
Does it look like I'm doing this correctly?
- 04-11-2012, 07:36 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 04-11-2012, 07:39 PM #3
Senior Member
- Join Date
- Oct 2011
- Posts
- 115
- Rep Power
- 0
Re: Binary Search Tree (traversals) Question
Doing the problems...does the tree look correct. And then for part 2, do my traversals of that tree look correct?
- 04-11-2012, 07:42 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 04-11-2012, 07:45 PM #5
Senior Member
- Join Date
- Oct 2011
- Posts
- 115
- Rep Power
- 0
Re: Binary Search Tree (traversals) Question
For part 2 you have to take the words off the tree in a certain order based on what traversal it is. I Google'd each and after readin what they were supposed to do I implemented it on my tree. However, I'm not sure if they are correct.
- 04-11-2012, 07:48 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: Binary Search Tree (traversals) Question
Show us your implementation of the different traversals.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
- 04-11-2012, 08:00 PM #7
Senior Member
- Join Date
- Oct 2011
- Posts
- 115
- Rep Power
- 0
- 04-11-2012, 08:20 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Similar Threads
-
Binary search tree
By hansmoolman in forum New To JavaReplies: 2Last Post: 10-28-2010, 02:59 PM -
Data Structures(Binary Search Tree to AVL Tree)ASAP pls
By jfAdik in forum Forum LobbyReplies: 0Last Post: 04-04-2010, 08:40 AM -
Binary search tree search method
By chopo1980 in forum New To JavaReplies: 2Last Post: 12-10-2009, 02:42 AM -
Binary Tree Traversals and Swapping
By Sylar in forum New To JavaReplies: 0Last Post: 03-08-2009, 08:52 AM -
Binary Search Tree
By Goo in forum New To JavaReplies: 0Last Post: 03-06-2009, 05:46 PM
Bookmarks