Question: Please code in Java - - - - - - Create a client class that does the following: - ArrayStack o Push 1 0 random

Please code in Java ------Create a client class that does the following:
- ArrayStack
o Push 10 random integers onto the stack, printing out each value as it is pushed onto the stack
o Pop the stack until it is empty printing out each value as it is popped off the stack
- LinkedStack
o Repeat the steps done with the ArrayStack
- ArrayQueue
o Enqueue 10 random integers into the queue, printing out each value as it is enqueued into the queue
o Dequeue the queue until it is empty printing out each value as it is dequeued from the queue
- LinkedQueue
o Repeat the steps done with the ArrayQueue
- LinkedPositionalList
o Add 10 random integers into the list, printing out each value as it is added.
o Move forward through the list, staring at the first position and getting each next position using the list iterator, printing the element at each position.
o Move backward through the list using the last and before methods, printing the element at each position.
- LinkedBinaryTree
- Manually creates an instance of a binary expression tree that represents the following expression:
-((9*8)+17)/(14+23)*-2
- Do this by using methods such as attach, set, addRoot, addLeft, and addRight.
- The element should be of type String
- Note that you are manually building this specific expression tree.
- The pseudo code might look something like:
o Create a LinkedBinaryTree with 2 as its root element.
o Create another LinkedBinaryTree with 9 as its root element.
o Create a third LinkedBinaryTree with + as its root element.
o Attach the tree with the 2 as the left child and the tree with the 9 as the right child to the tree with the +.
o You now have a subexpression that can be attached to the expression tree as you build it.
o etc.
The above example implies a bottom-up construction of the tree. You should determine if it is easier to build the tree in a top-down fashion or in a bottom-up fashion.
Once you have created the expression tree have your client print out the following:
- The literal string that represents the expression, i.e.:
((9*8)+17)/(14+23)*-2
- The height of the expression tree
- The preOrder traversal of the tree
- The inOrder traversal of the tree
- The postOrder traversal of the tree
- The breathFirst traversal of the tree
- The parenthesized representation of the tree using Eulers Tour ( section 8.4.6 and Code Fragment 8.29), this is NOT the parenthesize() method in Code Fragment 8.26.
 Please code in Java ------Create a client class that does the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!