2016年4月9日

Implement Stack using Queues

摘要: 这题是使用队列去实现栈,属于比较基础的题目。需要考虑的点在于队列为先进先出,即入队在队尾,但是出队在队首,而栈为先进后出,即出栈和入栈都在栈尾。需要实现的功能如下: push(x) -- Push element x onto stack. pop() -- Removes the element 阅读全文

posted @ 2016-04-09 23:13 Sheryl Wang 阅读(286) 评论(0) 推荐(0) 编辑

导航