linkedStackType<int>
myStack;
myStack.push(10);
myStack.push(20);
myStack.pop();
cout<<myStack.top()<<endl;
myStack.push(25);
myStack.push(2*myStack.top());
myStack.push(-10);
myStack.pop();
linkedStackType<int>tempStack;
tempStack=myStack;
while(!tempStack.isEmptyStack())
{
cout<<tempStack.top()<< “
”;
tempStack.pop();
}
cout<<endl;
cout<<myStack.top()<<endl;
Stack s = new Stack();
s.push(7);
s.push(3);
s.push(4);
s.pop();
s.Push (8);
s.pop();
s.pop();
s.Push (2);
s.Push (9);
s.Push (5);
s.pop();
s.pop();
linkedStackType myStack; myStack.push(10); myStack.push(20); myStack.pop(); cout<
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am