摘要:
题目:Given an integer, write a function to determine if it is a power of two.提示:此题判断输入的数是否是2的次方。如果一个数是2的次方,那么它的二进制数只有一个1,其他都是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... 阅读全文
摘要:
题目: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... 阅读全文