insert(4), insert(8), insert(1), insert(6), remove(), remove()when applied to
a stack
a queue
a priority queue
Would you use Bitdiddles' program to check your input text? Explain why or why not. If there are input strings for which Bitdiddle's algorithm won't work, give examples of those input strings.
(a) Write a method, reversePrint(), that uses a Stack to print the items in the list in reverse order.
Assume a Stack ADT is already implemented and that the Stack ADT has methods isEmpty(), Push(item) and Pop(), which respectively return a boolean, push and pop items of type Comparable.
You shouldn't need to write more than 10 new lines of code.
class List{ ListNode Head; void reversePrint(){ Stack S = new Stack(); }(b) What is the time complexity of the above reversePrint method (using the big-Oh notation)?