bst :binary search tree(二叉搜索树)对于树中的每个节点n,左子树中的所有节点的关键字都小于节点n的关键字,右子树中所有节点的关键字都大于节点n的关键字struct node{ int key; struct node *left; //左节点 s...
分类:
其他好文 时间:
2014-06-28 17:06:24
阅读次数:
186
题目:Binary Tree Level Order Traversal i iii和ii的差别仅在于最后将结果逆序一下就行了,算法上基本相同个人思路:1、二叉树的层次遍历,我们一层一层地处理,用一个队列(A队列)将每一层的所有节点按照从左到右的顺序入队2、待该队列的所有节点都出队,并且用另外一个队...
分类:
其他好文 时间:
2014-06-28 17:01:33
阅读次数:
235
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example, Given n = 3, there are a total of 5 unique BST'...
分类:
其他好文 时间:
2014-06-28 11:57:50
阅读次数:
232
安装ns3的一系列包,脚本如下:#!/bin/shsudo apt-get install gcc g++ python python-pygccxmlsudo apt-get install gcc g++ python python-devsudo apt-get install mercuri...
分类:
系统相关 时间:
2014-06-28 11:39:15
阅读次数:
361
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3]...
分类:
其他好文 时间:
2014-06-20 19:37:40
阅读次数:
136
题目:Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmet...
分类:
其他好文 时间:
2014-06-20 18:44:41
阅读次数:
279
一、排序 select * from employees order by name; 字符型默认字符顺序(也就是说z永远比a大),不管大小写;如果想按编码值排序(也就是说小写永远大于大写),则使用 select * from employees order by binary name;二、...
分类:
数据库 时间:
2014-06-20 18:00:44
阅读次数:
278
gcc是C编译器;g++是C++编译器;linux下cc一般是一个符号连接,指向gcc;gcc和g++都是GUN(组织)的编译器。而CC则一般是makefile里面的一个名字,即宏定义,嘿,因为Linux/Unix都是大小写敏感的系统,这点一定要注意。cc是Unix系统的C Compiler,而gc...
分类:
其他好文 时间:
2014-06-20 17:21:07
阅读次数:
266
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-06-20 15:30:19
阅读次数:
227
1. loadsloads [ off ]通过串口,下载S-Rec文件到off位置loads命令可以通过串口线下载S-Record格式文件。2. loadbloadb [ off ] [ baud ]通过串口,以baud速率,下载binary到off位置(即:kermit protocol)load...
分类:
数据库 时间:
2014-06-20 14:11:51
阅读次数:
607