The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of ...
分类:
其他好文 时间:
2015-01-13 17:45:19
阅读次数:
140
因需要做了一个截取显示对象图片上传至服务器,纠结了好多种方法都无果,今天突然发现了真面目: 上传图片至服务器的三种方式分别为: 1、二进制传输(BINARY) 2、字符串传输(String) 3、文件流上传(File) 第三种要借助FileReference,但是在此不能用这个,所以过。就剩前面两种...
分类:
Web程序 时间:
2015-01-13 17:35:07
阅读次数:
123
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
https://oj.leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered ...
分类:
其他好文 时间:
2015-01-13 14:14:55
阅读次数:
125
https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes alo...
分类:
其他好文 时间:
2015-01-13 14:13:55
阅读次数:
105
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2015-01-13 12:33:11
阅读次数:
118
静态查找表顺序查找有序查找折半查找(binary search)判定树 折半查找只适用于有序表,且限于顺序存储结构(对线性链表无法有效的进行折半查找)斐波那契查找:根据斐波那契序列的特点进行分割,假设开始时表中记录个数比某个斐波那契数小1即n=fu-1,然后将给定值key和 [fu -1 ].key...
分类:
其他好文 时间:
2015-01-13 07:50:39
阅读次数:
243
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
编程语言 时间:
2015-01-13 06:42:51
阅读次数:
201
描述GiventwostringsAandB,whosealphabetconsistonly‘0’and‘1’.YourtaskisonlytotellhowmanytimesdoesAappearasasubstringofB?Forexample,thetextstringBis‘1001110110’whilethepatternstringAis‘11’,youshouldoutput3,becausethepatternAappearedattheposit输入Thefir..
分类:
其他好文 时间:
2015-01-13 01:33:32
阅读次数:
132
Slim Span
[PDF Link]
Given an undirected weighted graph G , you should find one of spanning trees specified as follows.
The graph G is an ordered pair (V, E) ,
where V is a set of vertices {v1,...
分类:
编程语言 时间:
2015-01-12 22:37:21
阅读次数:
391