这个题刚开始是看错题了。。一点思路都没有到后来把题目看对了以后,有一点思路,但还是不会做。。无奈只能看官方题解官方题解是这样的:First convert number k into binary number system. If some bit of k is 0 than the resul...
分类:
其他好文 时间:
2015-06-15 10:51:30
阅读次数:
112
Implement Stack using Queues
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.top() -- Get the ...
分类:
其他好文 时间:
2015-06-14 20:05:25
阅读次数:
192
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
系统相关 时间:
2015-06-14 16:23:48
阅读次数:
176
题意:
有一个初始状态全为0的矩阵,一共有三个操作
1 x1 y1 x2 y2 v:子矩阵(x1,y1,x2,y2)所有元素增加v
2 x1 y1 x2 y2 v:子矩阵(x1,y1,x2,y2)所有元素设为v
3 x1 y1 x2 y2 v:查询子矩阵(x1,y1,x2,y2)的元素和,最大值和最小值
思路:
因为总元素葛素不超过10^6,而且更新是对于连续的行进行更新,...
分类:
其他好文 时间:
2015-06-14 12:32:24
阅读次数:
169
【题目】
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.top() -- Get the top element.empty() -- R...
分类:
其他好文 时间:
2015-06-14 10:59:41
阅读次数:
160
遇到ORA-14047: ALTER TABLE|INDEX RENAME may not be combined with other operations错误...
分类:
其他好文 时间:
2015-06-14 01:54:03
阅读次数:
208
https://leetcode.com/problems/implement-stack-using-queues/Implement the following operations of a stack using queues.push(x) -- Push element x onto s...
分类:
其他好文 时间:
2015-06-13 16:54:34
阅读次数:
154
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.top() -- Get the top element.empty() -- Return whet...
分类:
其他好文 时间:
2015-06-13 15:42:34
阅读次数:
132
Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the eleme...
分类:
编程语言 时间:
2015-06-13 01:04:13
阅读次数:
249
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.top()...
分类:
其他好文 时间:
2015-06-12 18:51:59
阅读次数:
87