序列化:对象--->流--->文件、二进制using System.Runtime.Serialization.Formatters.Binary;//二进制序列化器所在命名空间using System.Runtime.Serialization.Formatters.Soap;//using Sy...
分类:
其他好文 时间:
2015-03-20 09:13:07
阅读次数:
135
一、遍历二叉树
1.定义
二叉树的遍历(travering binary tree)是指从根结点出发,按照某种次序依次访问二叉树中的所有结点,使得每个结点被访问一次且仅被访问一次。
2.前序遍历
(1)规则:若二叉树为空,则空操作返回。否则,先访问根结点,然后前序遍历左子树,再前序遍历右子树。
(2)实例
前序遍历结果为:A
BDGH CEIF
分析:当...
分类:
其他好文 时间:
2015-03-20 01:25:12
阅读次数:
206
一、二叉树基本概念
1.定义
二叉树(Binary Tree)是n(n>=0)个结点的有限集合,该集合或者为空集(或称空二叉树),或者由一个根节点和两颗互不相交的、分别称为根结点的左子树和右子树的二叉树组成。
2.二叉树特点
(1)每个结点最多有两颗子树,所以二叉树中不存在度大于2的结点;
(2)左子树和右子树是有顺序的,次序不能任意颠倒;
(3)即使树中某节点只有一颗子树,也...
分类:
其他好文 时间:
2015-03-20 01:25:05
阅读次数:
181
/* 给一颗二叉树,问是否关于中心对称*//** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNod...
分类:
其他好文 时间:
2015-03-19 23:46:10
阅读次数:
152
/*判断一颗二叉树是否是平衡二叉树(左右子节点的高度差不超过1或者是颗空树)*//** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *righ...
分类:
其他好文 时间:
2015-03-19 23:28:57
阅读次数:
200
题目链接:Add Binary
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
这道题的要求是两个二进制字符串加法运算。
简单的大数加法,只不过是二进制的。处理进位的时候,按照二进制处理即可。
时间复杂度...
分类:
其他好文 时间:
2015-03-19 21:57:35
阅读次数:
124
https://leetcode.com/problems/sum-root-to-leaf-numbers/Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a num...
分类:
其他好文 时间:
2015-03-19 17:51:26
阅读次数:
150
题目描述:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), re...
分类:
其他好文 时间:
2015-03-19 17:48:43
阅读次数:
123
MongoDB数据模型和索引学习总结
1. MongoDB数据模型:
MongoDB数据存储结构:
MongoDB针对文档(大文件采用GridFS协议)采用BSON(binary json,采用二进制编码)数据格式来存储和交换数据。Bson吸收了JSON schema-less的特点,存储结构松散,不需要像RDB(关系数据)那样事先定义数据存储的元数据结构,另外增加了多种数据类型...
分类:
数据库 时间:
2015-03-19 16:28:42
阅读次数:
382
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2015-03-19 12:58:48
阅读次数:
116