Mohammad Aryafar
Wednesday, 9 October 2013
reverse() and copy constructor
Reverse:
void Stack::reverse(){
Stack tmp=*this;
_top=(Node*)0;
while(!tmp.isEmpty()){
push(tmp._top->_data);
tmp.pop();
}
}
Copy Constructor
Stack::Stack(const Stack& S){
_top=(Node*)0;
_top=S._top;
}
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment