3. Write a method that will take two sorted stacks a and b (min on top) and create one stack that is sorted (min on top). You are allowed to use only the stack operations such as pop, push, size and...


java


dont use others answers please


follow thw istructions on the photo


Thank you!!!


3. Write a method that will take two sorted stacks a and b (min on top) and create one stack that is sorted<br>(min on top). You are allowed to use only the stack operations such as pop, push, size and top (top()<br>returns the top element on the stack).<br>No other data structures such as arrays are not allowed.<br>You are allowed to use only stacks. Note that elements on the stack can be compared using compareTo.<br>public Stack mergeSortedStacks(Stack a, Stack b)<br>{<br>

Extracted text: 3. Write a method that will take two sorted stacks a and b (min on top) and create one stack that is sorted (min on top). You are allowed to use only the stack operations such as pop, push, size and top (top() returns the top element on the stack). No other data structures such as arrays are not allowed. You are allowed to use only stacks. Note that elements on the stack can be compared using compareTo. public Stack mergeSortedStacks(Stack a, Stack b) {

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here