Beispiel #1
0
 public static void main()
 {
     Stack s = new Stack();
     s.push(19);
     s.push(10);
     s.push(11);
     s.pop();
     s.peek();
 }
 public Stack sort(Stack s)
 {
     while (!s.isEmpty())
     {
         int tmp = s.pop();
         while (!tempStack.isEmpty() && tempStack.peek() > tmp)
         {
             s.push(tempStack.pop());
         }
         tempStack.push(tmp);
     }
     return tempStack;
 }
 public void print(Stack s){
     while (!s.isEmpty())
     {
         Console.WriteLine(s.pop());
     }
 }