Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
分类:
其他好文 时间:
2015-01-19 23:28:51
阅读次数:
244
Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the tot...
分类:
其他好文 时间:
2015-01-19 23:27:51
阅读次数:
244
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876657
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Re...
分类:
其他好文 时间:
2015-01-19 21:11:04
阅读次数:
184
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876699
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Re...
分类:
其他好文 时间:
2015-01-19 21:09:52
阅读次数:
145
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876769
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: ...
分类:
其他好文 时间:
2015-01-19 21:09:14
阅读次数:
152
线索二叉树:指向前驱和后继的指针称为线索,加上线索的二叉链表称为线索链表,相应的二叉树称为线索二叉树(Threaded Binary Tree)。
线索化:对二叉树以某种次序遍历使其变为线索二叉树称作是线索化。线索化的过程就是在遍历的过程中修改空指针的过程。
代码:
#include "string.h"
#include "stdio.h"
#include "stdlib....
分类:
其他好文 时间:
2015-01-19 21:04:42
阅读次数:
139
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Runtime.Serialization.Formatters.Binary;using System.Text...
原题地址递归写法谁都会,看看非递归写法。对于二叉树的前序和中序遍历的非递归写法都很简单,只需要一个最普通的栈即可实现,唯独后续遍历有点麻烦,如果不借助额外变量没法记住究竟遍历了几个儿子。所以,最直接的想法就是在栈中记录到底遍历了几个儿子。代码: 1 vector postorderTraversal...
分类:
其他好文 时间:
2015-01-19 18:40:29
阅读次数:
116
预备知识:
fstream提供了三个类,用来实现c++对文件的操作。(文件的创建、读、写)。
ifstream -- 从已有的文件读
ofstream -- 向文件写内容
fstream -- 打开文件供读写
文件打开模式:
ios::in 读
ios::out 写
ios::app 从文件末尾开始写
ios::binary 二进制模式
ios::nocreate ...
分类:
编程语言 时间:
2015-01-19 17:17:42
阅读次数:
182
方法1)select * from mytable order by CONVERT(chineseColumnName USING gbk); (备注:chineseColumnName 位排序字段)方法2)对于包含中文的字段加上"binary"属性,使之作为二进制比较,例如将"name char...
分类:
数据库 时间:
2015-01-19 12:44:22
阅读次数:
183