Solved

binary search tree

Posted on 2004-04-17
3
172 Views
Last Modified: 2010-03-31
Hi, I have to implement this:
Say I am given a text,

why am fish, !
why do swim

I am to produce the following output using binary search tree.

am
do
fish
swim
why

Ok. My question. If i were to use the comparable interface, i do not need to use the euler's rule to traverse through the tree to print out the nodes in alphabetical order, right? So, how do i print it out?

0
Comment
Question by:shiehnee
3 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 50 total points
ID: 10852325
the comparable interface will help to fill your binary tree with the data.
i.e.: you save it to the left if smaller than parent node and to the right otherwise.
you'll fill your tree with all your data, and then you'll need to traverse it (left-to-right) to get your sorted output.  i don't know about the "euler's rule" for binary trees.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now