Blog on algorithms, puzzles, programming .... musings of a computer engineer.
template <typename T>void ReverseStack(Stack s){ if ( s.isEmpty() ) return; // nothing to do else { T elem = s.Top(); s.Pop(); ReverseStack(s); s.Push(elem); }}
Post a Comment
No comments:
Post a Comment