码迷,mamicode.com
首页 > 其他好文
LeetCode Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.思路分析:判断两个树是否相同,基本也...
分类:其他好文   时间:2015-03-19 06:23:30    阅读次数:95
ADSL看见了看见过
http://bbs.uuu9.com/space-uid-753278.html http://bbs.uuu9.com/thread-11335568-1-1.html http://bbs.uuu9.com/thread-11335595-1-1.html http://bbs.uuu9.com/thread-11335642-1-1.html http://bbs.uuu9.com...
分类:其他好文   时间:2015-03-19 06:23:31    阅读次数:165
LeetCode – Refresh – Convert Sorted Array to Binary Search Tree
It is kind of binary search. Since this is a sorted array, we can treat it as inorder traversal. And we can define the root node for the Tree.So find ...
分类:其他好文   时间:2015-03-19 06:19:48    阅读次数:105
LeetCode – Refresh – Clone Graph
1. Use BFS to search the graph.2. Create a hashtable to record the one to one mapping. 1 /** 2 * Definition for undirected graph. 3 * struct Undirec.....
分类:其他好文   时间:2015-03-19 06:19:16    阅读次数:125
LeetCode – Refresh – Container With Most Water
The minimum height controls the volumns. So let two runner at two ends start to scan the array. 1 class Solution { 2 public: 3 int maxArea(vector ...
分类:其他好文   时间:2015-03-19 06:21:12    阅读次数:147
LeetCode – Refresh – Construct Binary Tree from Inorder and Postorder Traversal
For this problem just need to know the structure of two traversal.1. It is hard to find the root node in the inorder traversal but it is easy in posto...
分类:其他好文   时间:2015-03-19 06:19:44    阅读次数:119
LeetCode – Refresh – Combination Sum II
The different between I and II is that:1. For II, each number only can be chosen ONCE.2. The a number, in the array, encountered more than twice will ...
分类:其他好文   时间:2015-03-19 06:18:55    阅读次数:135
关于TOP (n) WITH TIES的运用
1 SELECT TOP (5) orderid, orderdate, custid, empid2 FROM Sales.Orders3 ORDER BY orderdate DESC, orderid DESC;4 5 SELECT TOP (5) WITH TIES orderid, ord...
分类:其他好文   时间:2015-03-19 06:20:19    阅读次数:142
LeetCode – Refresh – Convert Sorted List to Binary Search Tree
Similar to the sorted array. But we have to remember, the position of node not depends on the index. So we need do two more things:1. Ensure the point...
分类:其他好文   时间:2015-03-19 06:20:30    阅读次数:132
LeetCode – Refresh – Combinations
Same algorithm with combination. Input as the (1..n), constraint is that the length of each combine should be k. 1 class Solution { 2 public: 3 vo...
分类:其他好文   时间:2015-03-19 06:20:58    阅读次数:152
HackerRank - Knapsack
Very good problem to learn knapsack (complete knapsack in this case).My brutal-force solution in Python got AC too, which surprised me a bit. Here is ...
分类:其他好文   时间:2015-03-19 06:18:36    阅读次数:135
LeetCode – Refresh – Compare Version Numbers
Two notes:1. I dont know whether C++ has a good split function for STL as the JAVA. Need to figure it out.2. At the beginning, I tried to set tmp1 = t...
分类:其他好文   时间:2015-03-19 06:17:36    阅读次数:130
LeetCode – Refresh – Construct Binary Tree from Inorder and Preorder Traversal
Only different with preorder and postorder is that the root start from the beginning for preorder. 1 /** 2 * Definition for binary tree 3 * struct T.....
分类:其他好文   时间:2015-03-19 06:20:26    阅读次数:122
LeetCode – Refresh – Combination Sum
This is a classical combination question. 1 class Solution { 2 public: 3 void getComb(vector > &result, const vector &num, vector current, int sum...
分类:其他好文   时间:2015-03-19 06:17:15    阅读次数:97
getopt例子
(本例基于win7 + python3.4)import getopt, sys'''getopt 模块专门用来处理命令行参数函数getopt(args, shortopts, longopts = [])参数 args 一般是sys.argv[1:] shortopts ...
分类:其他好文   时间:2015-03-19 06:18:43    阅读次数:121
tomcat7.0设置多域名指向同IP不同项目
核心配置: www.yitechan.com.cn www.yitechan.com 附上源文件 文件名:tomcat多域名同IP 链接: http://pan.baidu.com/s/1gdw5OI3 密码: texe
分类:其他好文   时间:2015-03-19 06:18:11    阅读次数:160
决策树-ID3
id3:无法直接处理数值型数据,可以通过量化方法将数值型数据处理成标称型数据,但涉及太多特征划分,不建议决策树:的最大优点在于可以给出数据的内在含义,数据形式非常容易理解;决策树介绍:决策树分类器是带有种植的流程图,终止块表示分类结果 优点:计算复杂度不高,输出结果易于理解,对中间值的缺失不明感,....
分类:其他好文   时间:2015-03-19 06:17:11    阅读次数:133
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!