Generate 100 random numbers and add them to a stack and a queue, after print out the
Question:
Generate 100 random numbers and add them to a stack and a queue, after print out the content from both stack and queue, sort the data from both in ascending order, then print out again, after being sorted, and go through both the stack a queue and remove an element one at a time till empty then print out a message saying its empty. print out how much time it took to do this process, basically compare the stack and the queue. the stack should use an array with initial size of 50 and increase if need be. the queue should use a linkedlist.
stack should have: push, pop, front, peek, isEmpty
queue: enqueue, dequeue, front, peek, isEmpty
Write this code in Java
A Survey of Mathematics with Applications
ISBN: 978-0134112107
10th edition
Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde