题目:
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note:...
分类:
编程语言 时间:
2015-01-14 18:01:28
阅读次数:
182
点击打开链接
1260. Nudnik Photographer
Time limit: 1.0 second
Memory limit: 64 MB
If two people were born one after another with one second difference and one of them is a child, then th...
分类:
其他好文 时间:
2015-01-14 12:47:15
阅读次数:
125
问题描述:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 ele...
分类:
其他好文 时间:
2015-01-13 23:17:46
阅读次数:
330
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will
return the next smallest number in the BST.
Note: next() a...
分类:
编程语言 时间:
2015-01-13 14:25:39
阅读次数:
240
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements.
Y...
分类:
编程语言 时间:
2015-01-12 22:34:27
阅读次数:
274
git initgit add *git commit -m "aaa" (git commit) (git commit -v)git statusgit diff #see the difference between modified files and staged files (git d...
分类:
其他好文 时间:
2015-01-12 06:51:03
阅读次数:
337
Given two sorted arrays A, B of size m and n respectively. Find the k-th smallest element in the union of A and B. You can assume that there are no du...
分类:
其他好文 时间:
2015-01-11 22:48:15
阅读次数:
187
#include
#include
#include
#include
#include "oj.h"
using namespace std;
bool comp(int iElem1, int iElem2)
{
string str1;
char ch1[100];
memset(ch1, 0, sizeof(char) * 100);
itoa(iElem1, ch1, ...
分类:
其他好文 时间:
2015-01-10 15:17:15
阅读次数:
153
这是本人在研究leetcode中Median of Two Sorted Arrays一题目的时候看到一篇文章,觉得非常好,其中对快速排序重新实现。
文章来源于http://www.geeksforgeeks.org/这个网站。
We recommend to read following post as a prerequisite of this post.
K’th Sma...
分类:
其他好文 时间:
2015-01-09 10:45:54
阅读次数:
189
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note: next()...
分类:
其他好文 时间:
2015-01-06 20:09:24
阅读次数:
159