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 ...
分类:
其他好文 时间:
2014-09-19 01:06:54
阅读次数:
301
Zygote.Human.Factors.7.0.Win32_64 2CD SolidWorks人体模型插件人机工程Human solution Ramsis 3821 Standalone车辆设计人机工程总布置工具Human factors for SolidWorks是用于SolidWorks三...
分类:
Windows程序 时间:
2014-09-18 14:38:33
阅读次数:
1315
左右两次遍历,记录以当前元素结尾的左边最大字串和以及右边最大字串和,最后遍历,相加 1 // you can also use includes, for example: 2 // #include 3 #include 4 #include 5 int solution(vector &A...
分类:
其他好文 时间:
2014-09-18 11:10:43
阅读次数:
197
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-09-18 07:30:53
阅读次数:
232
分解质因数求最大公约数求最小公倍数牛顿迭代求平方根分解质因数import java.util.ArrayList;import java.util.List;public class Solution { // 返回质因数分解 List getPrimeFactors(int n) { ...
分类:
其他好文 时间:
2014-09-17 18:19:42
阅读次数:
241
Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co...
分类:
其他好文 时间:
2014-09-17 11:35:22
阅读次数:
186
class Solution {private: int shd_cnt[256]; int cur_cnt[256];public: string minWindow(string S, string T) { int slen = S.length(); ...
http://www.jb51.net/os/78318.htmlCentOS 6.4 下载地址:http://www.jb51.net/softs/78243.html1、首先,要有一张CentOS 6.4的安装介质,使用介质启动电脑出现如下界面界面说明:Install or upgrade an...
分类:
其他好文 时间:
2014-09-16 12:28:30
阅读次数:
189
这题挺有意思的,没想到规模大于3的slice的avg肯定要比它的子slice(小于3)的avg来得小的话,就不太好写。 1 int solution(vector &A) { 2 // write your code in C++98 3 int minStart = 0; 4 ...
分类:
其他好文 时间:
2014-09-15 22:48:49
阅读次数:
353
给定一系列词, 找出其中所有的变序词组合.Note: 变序词 - 组成字符完全相同但次序不同的单词. 如dog和god, ate和eat.算法描述: 使用map >存储所有的结果. 最后将map中size > 1的vector插入到结果中.代码: 1 class Solution { 2 publi...
分类:
其他好文 时间:
2014-09-15 19:21:29
阅读次数:
231