序列化: 对象-->流-->保存到文件一个类要想被序列化,必须加 [Serializable]标识为可序列化 二进制序列化器: 命名空间: using System.Runtime.Serialization.Formatters.Binary; 类: BinaryFormatter------.....
分类:
其他好文 时间:
2015-05-15 19:39:09
阅读次数:
113
题目:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution s...
分类:
其他好文 时间:
2015-05-15 13:21:07
阅读次数:
113
题目:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattene...
分类:
其他好文 时间:
2015-05-15 10:23:04
阅读次数:
119
题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / ...
分类:
其他好文 时间:
2015-05-15 10:22:50
阅读次数:
125
题目描述:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
即给定一个升序排列的数组,现在将它转换成一个平衡二叉树。
解题思路;
数组排好序,相当于我们最后y...
分类:
其他好文 时间:
2015-05-15 09:12:18
阅读次数:
113
描述:
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
思路:
将字符串从后向前进行相加,最后有进位的话再创造新的位数,最后将字符串反转,输出即可。...
分类:
其他好文 时间:
2015-05-15 09:06:04
阅读次数:
99
描述:
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.
The array may contain multiple peaks, in that case return the index to any one of the peaks is f...
分类:
其他好文 时间:
2015-05-15 09:03:58
阅读次数:
134
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical...
分类:
其他好文 时间:
2015-05-15 09:01:13
阅读次数:
145
It's year 2465, and you are the Chief Engineer for Glorified Lumberjacks Inc. on planet Trie. There is a number of trees that you need to cut down, and the only weapon you have is a high-powered antim...
分类:
其他好文 时间:
2015-05-14 23:52:18
阅读次数:
198
题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space ...
分类:
其他好文 时间:
2015-05-14 23:37:22
阅读次数:
159