Fork me on GitHub
摘要: 题目:Given an integer, write a function to determine if it is a power of two.提示:此题判断输入的数是否是2的次方。如果一个数是2的次方,那么它的二进制数只有一个1,其他都是0。根据这一定理,我们可以用如下方法解决这一问题:第一... 阅读全文
posted @ 2015-09-01 16:03 __Neo 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.to... 阅读全文
posted @ 2015-09-01 14:53 __Neo 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in fron... 阅读全文
posted @ 2015-09-01 14:30 __Neo 阅读(115) 评论(0) 推荐(0) 编辑