摘要: 二叉树是比较经典的数据结构,而遍历则是树最基本的操作。有先序遍历,中序遍历,后序遍历,先后针对的是根节点。 树本身就是递归定义,因此使用递归来实现三种遍历很容易。 以上是递归法遍历树的简单实现。优点:简单易读,思路清晰,能很快写出来。 缺点:要使用栈空间保存现场,递归太深容易造成栈空间溢出。 所有的 阅读全文
posted @ 2016-03-03 21:03 BestWangJie 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 建表:CREATE TABLE Course ( Cno Char(4) PRIMARY KEY, Cname Char(40), Cpno Char(4), Ccredit Int, FOREIGN KEY (Cpno) REFERENCES Course(Cno) );插入数据:... 阅读全文
posted @ 2015-11-07 11:10 BestWangJie 阅读(4175) 评论(0) 推荐(0) 编辑
摘要: 2015年8月24日 08:15:17 目前基本完成了简单的2D稳像,但是帧图像局部抖动,以及图像模糊时候的处理仍然有问题。 本周开始着手这个问题的研究。(1)研究KLT算法自身的准确性。(2)使用自己模拟的抖动视频来进行测试。 阅读全文
posted @ 2015-08-24 08:20 BestWangJie 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((... 阅读全文
posted @ 2015-05-10 16:05 BestWangJie 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the c... 阅读全文
posted @ 2015-05-10 14:46 BestWangJie 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic... 阅读全文
posted @ 2015-05-10 13:31 BestWangJie 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
posted @ 2015-05-03 19:08 BestWangJie 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.... 阅读全文
posted @ 2015-04-26 22:05 BestWangJie 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ... 阅读全文
posted @ 2015-04-26 20:23 BestWangJie 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.这题是寻找一组字符串的最长公共前缀,举个例子:“abc” "a"显然lPrefixString = "a",注意检查空串的情况!... 阅读全文
posted @ 2015-04-25 19:12 BestWangJie 阅读(133) 评论(0) 推荐(0) 编辑