Assume the only data structure available for use is a stack. How would you implement a queue functionality using stack ?
hint : you can use multiple stacks..
solution : http://stackoverflow.com/questions/69192/using-stack-as-queue !
Note : on similar lines, it should be possible to implement a stack using queue..
No comments:
Post a Comment