1119. Pre- and Post-order Traversals (30) Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be deter ...
分类:
其他好文 时间:
2017-03-04 00:25:17
阅读次数:
187
加分二叉树 (binary) 【问题描述】 设一个 n 个节点的二叉树 tree 的中序遍历为( l,2,3,…,n ),其中数字 1,2,3,…,n 为节点编号。每个节点都有一个分数(均为正整数),记第 j 个节点的分数为 di , tree 及它的每个子树都有一个加分,任一棵子树 subtree ...
分类:
其他好文 时间:
2017-03-02 19:22:30
阅读次数:
203
由于是满二叉树,用数组既可以表示父节点是i,则左孩子是2*i,右孩子是2*i+1另外根据二分搜索树的性质,中序遍历恰好是从小到大排序因此先中序遍历填充节点对应的值,然后再层次遍历输出即可。 又是一道遍历的水题。。。 #include <iostream> #include <cstdio> #inc ...
分类:
其他好文 时间:
2017-03-02 12:58:39
阅读次数:
162
1. 折半查找 -- Binary Insertion Sort 时间复杂度 : O(n^2) 适用条件 : 相对直接插入排序,减少了数值的比较次数。适用于需要排序的数码比较少的情况。 输出: ...
分类:
编程语言 时间:
2017-03-01 00:47:50
阅读次数:
181
A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtree ...
分类:
其他好文 时间:
2017-03-01 00:27:12
阅读次数:
233
Usage: pg_dump [OPTION]... [DBNAME] 数据库名放最后,不指定默认是系统变量PGDATABASE指定的数据库。 General options:(一般选项) -f, --file=FILENAME output file or directory name导出后保存的 ...
分类:
数据库 时间:
2017-02-28 20:54:25
阅读次数:
686
$(SRCROOT) :当前工程所在的目录。 http://blog.csdn.net/freedom2028/article/details/8658819 framework 的第三方库,只是参与link,并不会 build 进你自己新建的 .a的binary,所以,你的的项目必须同时引用 你自 ...
分类:
其他好文 时间:
2017-02-28 12:26:35
阅读次数:
148
1.Draw Directly XXXX …… 2.Memory + DrawImage XXX > 5fps 3.Memory + BitBlt XX > 15fps ...
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: ...
分类:
其他好文 时间:
2017-02-27 21:31:47
阅读次数:
151