码迷,mamicode.com
首页 >  
搜索关键字:binary index tree    ( 56466个结果
LeetCode:Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? ...
分类:其他好文   时间:2014-06-22 21:31:26    阅读次数:214
LeetCode——Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [3,2,1]. Note: Recursive solut...
分类:其他好文   时间:2014-06-22 20:58:01    阅读次数:157
《软件调试的艺术》笔记--检查和设置变量
1.使用print命令查看变量值 使用print命令(简写为p)可以查看变量值。 使用如下的程序1进行测试。 #include struct node{ int index; struct node* next; }; int main(void) { struct node head; head.index = 1;...
分类:其他好文   时间:2014-06-22 20:53:08    阅读次数:301
Geeks - Range Minimum Query RMQ范围最小值查询
使用线段树预处理,可以使得查询RMQ时间效率在O(lgn)。 线段树是记录某范围内的最小值。 标准的线段树应用。 Geeks上只有两道线段树的题目了,而且没有讲到pushUp和pushDown操作,只是线段树的入门了。 参考:http://www.geeksforgeeks.org/segment-tree-set-1-range-minimum-query/ 我修改了一下他的程序,使用...
分类:其他好文   时间:2014-06-22 18:08:05    阅读次数:217
Android kxml解析WBXML
WAP Binary XML定义好XML片断表述出同步服务器地址、远程数据库名称、登录账号等等内容一、两种访问方法:      目前的kxml支持两种wap格式:WBXML/WML。      而有两种方法将解析WBXML:      1。使用j2me将WBXML转换到XML;      2。使用kxml直接解析WBXML流。下面我在这里讨论一下使用第二种方法实现client代码解...
分类:移动开发   时间:2014-06-22 17:37:30    阅读次数:176
POJ2405-Beavergnaw
Beavergnaw Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6204   Accepted: 4090 Description When chomping a tree the beaver cuts a very specific shape out o...
分类:其他好文   时间:2014-06-22 17:06:55    阅读次数:233
Git 基本原理与常用命令
平时使用过两种版本控制软件 SVN 和 Git,平心而论,如果纯粹自己使用,那么绝对 Git 更加适合,本地库、远程库、离线工作、强大而灵活的分支、大名鼎鼎的Github, 这些都是选择 Git 的原因。Git 本质上是一套内容寻址文件系统。 从内部来看,Git 是简单的 key-value 数据存储。Git主要包含 3 类对象:blog(对应文件)、tree(对应目录)、commit。每次 Git 提交都会产生一个 commit 对象,并更新有改动的文件所关联的所有 tree 对象。多个 tree 对象一...
分类:其他好文   时间:2014-06-22 16:53:50    阅读次数:166
POJ 1785 Binary Search Heap Construction (线段树)
题目大意: 给出的东西要求建立一个堆,使得后面的数字满足堆的性质,而且字符串满足搜索序 思路分析: 用线段树的最大询问建树。在建树之前先排序,然后用中序遍历递归输出。 注意输入的时候的技巧。。。 #include #include #include #include #define lson num<<1,s,mid #define rson num<<1|1,m...
分类:其他好文   时间:2014-06-21 21:38:34    阅读次数:205
HDU 4107 Gangster Segment Tree线段树
这道题也有点新意,就是需要记录最小值段和最大值段,然后成段更新这个段,而不用没点去更新,达到提高速度的目的。 本题过的人很少,因为大部分都超时了,我严格按照线段树的方法去写,一开始居然也超时。 然后修补了两个地方就过了,具体修改的地方请参看程序。 知道最大值段和最小值段,然后修补一下就能过了。不是特别难的题目。 #include #include #include using na...
分类:其他好文   时间:2014-06-21 20:14:04    阅读次数:230
LeetCode——Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 求数字字符串的二进制和。同之前的数组代表数字,两个数组相加一样,只不过进位变成了2.可能两个串的长度不一样,故逆转,从左到右加下去,最后再逆转。 publi...
分类:其他好文   时间:2014-06-21 20:11:21    阅读次数:344
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!