题意:给出一棵二叉树,按照从上到下,从左到右输出所有节点的值,如果有一个节点没有赋值或者被多次赋值则输出not complete看的紫书照着敲的= = 先要将输入进来的值建成一颗二叉树(定义一个二叉树的节点,新建节点的函数,添加节点的函数),再对建好的二叉树遍历(BFS) 1 #include .....
分类:
其他好文 时间:
2015-03-09 23:39:22
阅读次数:
427
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-03-09 20:52:28
阅读次数:
160
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.知识点:二叉搜素树: 1. 如果root有左子节点,则所有左边的节点root; 3. root.lef.....
分类:
其他好文 时间:
2015-03-09 20:48:13
阅读次数:
182
简单递归,但代码简洁性有待提高我的代码/** * Definition for binary tree * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }...
分类:
其他好文 时间:
2015-03-09 15:58:27
阅读次数:
130
https://leetcode.com/problems/gray-code/The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negati...
分类:
其他好文 时间:
2015-03-09 15:53:12
阅读次数:
194
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-03-09 15:44:14
阅读次数:
186
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
#include
#include
#include
using namespace std;
stru...
分类:
其他好文 时间:
2015-03-09 14:29:02
阅读次数:
146
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur...
分类:
移动开发 时间:
2015-03-09 14:15:03
阅读次数:
128
usingSystem.Runtime.Serialization.Formatters.Binary;//引入供序列化Image对象使用/// /// 将byte[]转换为Image/// /// 字节数组/// ImagepublicImage ReadImage(byte[] bytes){M...
分类:
其他好文 时间:
2015-03-09 14:13:45
阅读次数:
117
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-03-09 12:39:01
阅读次数:
171