Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

java work

  Asked By: Lucas    Date: Mar 24    Category: Java    Views: 580
  

i'm new to java and we have been given this
assignment to sort out. ....i have no clue where to start, and my
course mates couldntcare less..if some one can help me a little bit
on how to start thi program..i will try an complete the rest..
thanks


You need to write a Java application (in a single file named
DequeTree.java) that
Generates a set of 10 random integers in the range 0-99.
Each value is stored at the rear of a deque.
The values are dequeued from the front of the deque and inserted into
a binary search tree.
The height of the tree is computed.
The above code is run from scratch 10,000 times and a histogram of
the heights is constructed, and the first 10 elements printed to the
terminal.
Your program should also contain the following modified version
Generate and store values as before.
The smaller of the values at the front and back of the queue is
dequeued and inserted into a binary tree.
The histogram of 10,000 tree heights is constructed as before.
The data structures used are as follows:

A deque which is to be implemented using an array of Objects.
(Use ArrayQueue.java which I have provided as a basis for this.)
A binary tree which is to be implemented using an array of ints.
Include a method for printing the tree's values in preorder, inorder,
and posorder.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on java work Or get search suggestion and latest updates.




Tagged: