Implement insert and delete in a tri-nary tree. A tri-nary tree is much like a binary tree but with three child nodes for each parent instead of two -...
分类:
其他好文 时间:
2014-10-19 02:40:16
阅读次数:
236
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:
其他好文 时间:
2014-10-19 01:21:45
阅读次数:
204
1、p或q为None的情况用开始的两个if语句进行判断;2、类中递归调用函数需要使用self进行调用;3、代码很简洁,最后几行通过同时为None和同时非None的条件进行判断; 1 # Definition for a binary tree node 2 # class TreeNode: 3 ....
分类:
编程语言 时间:
2014-10-19 01:17:13
阅读次数:
329
antlr-2.7.6.jaraopalliance.jarasm-3.3.jarasm-commons-3.3.jarasm-tree-3.3.jaraspectjrt.jaraspectjweaver.jarc3p0-0.9.1.2.jarcglib-nodep-2.1_3.jarcommons...
分类:
编程语言 时间:
2014-10-18 23:55:29
阅读次数:
307
#error caused by:#1:{} 没有考虑None输入#2:{1,2,2} 没有控制h和t#3:{4,-57,-57,#,67,67,#,#,-97,-97} 没有考虑负号,将s从str变成list,采用9999代表空数值;---------------------逐层进行对称性验证,....
分类:
编程语言 时间:
2014-10-18 22:16:24
阅读次数:
230
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-10-18 20:57:37
阅读次数:
229
//扩展方法$.extend($.fn.tree.methods, { getLevel:function(jq,target){ var l = $(target).parentsUntil("ul.tree","ul"); return l.length+1; ...
分类:
其他好文 时间:
2014-10-18 12:25:17
阅读次数:
283
题意:
一棵树 支持删边加边、路径权值加值、路径权值改值、路径求第二大的数字和其个数
思路:
LCT的第二题 题意已经把功能都告诉了 比较裸
要注意的是权值加值和改值两个操作的标记下放问题 要先down改值 再down加值
对于路径的操作通过mroot变换树的形态再access拿出路径比较方便 不要像我上一篇一样搞lca
代码:
#include
#include
#in...
分类:
其他好文 时间:
2014-10-18 11:14:06
阅读次数:
128
http://dotnetawesome.blogspot.com/2014/06/how-to-create-treeview-with-database-data-mvc4-aspnet.htmlhttp://www.guyellisrocks.com/2009/08/aspnet-mvc-wi...
分类:
Web程序 时间:
2014-10-18 11:04:46
阅读次数:
168
题目描述:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".解题方案: 1 class Solution { 2 public: 3 s...
分类:
其他好文 时间:
2014-10-18 10:56:14
阅读次数:
160