(Stack<Integer> s)
| 58 | } |
| 59 | |
| 60 | public static Stack<Integer> sort(Stack<Integer> s) { |
| 61 | Stack<Integer> r = new Stack<Integer>(); |
| 62 | while(!s.isEmpty()) { |
| 63 | int tmp = s.pop(); |
| 64 | while(!r.isEmpty() && r.peek() > tmp) { |
| 65 | s.push(r.pop()); |
| 66 | } |
| 67 | r.push(tmp); |
| 68 | } |
| 69 | return r; |
| 70 | } |
| 71 | |
| 72 | public static void main(String [] args) { |
| 73 | for (int k = 1; k < 100; k++) { |
no test coverage detected