The thought of the algorithm is as follows:(1) Initially set up an empty stack, sequentially read in parentheses;(2) If it is a right parentheses, or ...
分类:
移动开发 时间:
2014-08-04 21:26:37
阅读次数:
340
/* CSS Document */*{margin:0;padding:0; }body{font-size:12px;font-family: Arial,SimSun,"宋体";color:#333; background:#960400;}h1,h2,h3,h4,h5,h6{ font-si...
分类:
Web程序 时间:
2014-08-04 20:50:27
阅读次数:
226
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.方法:为了使BST高度平衡,要找链表中的中值作为当前根节点。/** * Defin...
分类:
其他好文 时间:
2014-08-04 20:37:47
阅读次数:
194
ExtJS常用代码集合,包括弹出提示框,登陆框,树状结构等等。?1. [代码]弹出提示框 Getting Started Example 2. [代码]树状结构图 ``` Tree ...
分类:
Web程序 时间:
2014-08-04 20:37:07
阅读次数:
414
复制和粘贴复制:Ctrl+Insert粘贴:Shift+Insert另外还可以设置点鼠标右键就是粘贴,设置选项在:Tools/Options/general的Right-button;将当前Shell中的内容复制到"记事本"中XShell中内置了这一功能,选中内容,鼠标右键,选择"ToNotepad",再选中"SelectArea"或者"All"或者"S..
分类:
其他好文 时间:
2014-08-04 18:10:28
阅读次数:
366
二叉树的遍历,给出前序和中序遍历,输出后序遍历。...
分类:
其他好文 时间:
2014-08-04 17:50:17
阅读次数:
284
参照这个博客的做法:请戳 ,还有这个的讲解:
询问区间中满足条件的连续最长区间通常属于区间合并问题。
节点增加4个域,lx:从区间左边数连续空房间的数目。rx:从区间右边数连续空房间的数目。ax:该区间中连续空房间的总数目
col:记录该区间住人的状态,1表示全住满,0表示全空,-1表示有可以住的房间。
查询是否有连续空房间数目num的时候,先查询左边,当tree[v]...
分类:
其他好文 时间:
2014-08-04 17:39:57
阅读次数:
365
问题:判断二叉树是否为镜像二叉树分析:递归判断,根节点单独判断,然后递归左结点和右结点,之后每次一起递归左结点的左结点和右结点的右结点比较,左结点的右结点和右结点的左结点比较/** * Definition for binary tree * struct TreeNode { * int ...
分类:
其他好文 时间:
2014-08-04 17:27:27
阅读次数:
175
链接求某一点到其它点距离和最小,求这个和,这个点 为费马点。做法:模拟退火 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using name....
分类:
其他好文 时间:
2014-08-04 17:03:17
阅读次数:
253
Given a binary tree, flatten it to a linked list in-place.For example, Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:
其他好文 时间:
2014-08-04 16:59:37
阅读次数:
246