1、
??
Recover Binary Search Tree
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 pretty...
分类:
其他好文 时间:
2014-06-20 10:13:49
阅读次数:
243
Enumerations and Structures
Enumerations 枚举的使用
使用 enum 定义一个枚举,枚举里面可以关联方法,比如下文中的描述方法
enum Rank: Int {
case Ace = 1
case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten
case Ja...
分类:
其他好文 时间:
2014-06-20 09:03:39
阅读次数:
322
题目
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node...
分类:
其他好文 时间:
2014-06-20 09:02:56
阅读次数:
232
杭电OJ(HDU)-ACM Steps-Chapter Two-《Biker's Trip Odometer》《Climbing Worm》《hide handkerchief》《Nasty Hac》...
分类:
其他好文 时间:
2014-06-07 11:39:31
阅读次数:
315
二维码:二维码(Two-dimensional
code),又称二维条码,它是用特定的几何图形按一定规律在平面(二维方向)上分布的黑白相间的图形,是所有信息数据的一把钥匙。在现代商业活动中,可实现的应用十分广泛,如:产品防伪/溯源、广告推送、网站链接、数据下载、商品交易、定位/导航、电子凭证、车辆管...
分类:
其他好文 时间:
2014-06-07 08:05:10
阅读次数:
269
枚举 使用enum创建枚举——注意 Swift 的枚举可以关联方法: 1 enum Rank:
Int { 2 case Ace = 1 case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten 3
case Jack, Q...
分类:
其他好文 时间:
2014-06-06 08:30:54
阅读次数:
285
雪花噪声即椒盐噪声,以前黑白电视常见的噪声现象。原理准备0°,45°,90°,135°4个方向的卷积模板。
用图像先和四个模板做卷积,用四个卷积绝对值最小值Min来检测噪声点。求灰度图gray与其中值滤波图median。判断噪声点:fabs(median-gray)>10
&& min>0.1。噪声...
分类:
其他好文 时间:
2014-06-05 14:31:42
阅读次数:
578
Given an array of integers, find two numbers
such that they add up to a specific target number.The function twoSum should
return indices of the two nu...
分类:
其他好文 时间:
2014-06-05 14:15:07
阅读次数:
221
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b ="1"Return"100".public class
Solution { /**The program is us...
分类:
其他好文 时间:
2014-06-05 14:08:35
阅读次数:
188
Given a linked list, swap every two adjacent
nodes and return its head.For example,Given1->2->3->4, you should
return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-06-05 13:41:44
阅读次数:
231