题目链接:https://oj.leetcode.com/problems/binary-tree-postorder-traversal/
题目:
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
...
分类:
其他好文 时间:
2015-02-02 23:22:05
阅读次数:
312
Given an array where elements are sorted in ascending order, convert it toa height balanced BST.
HideTags
Tree Depth-first
Search
#pragma once
#include
#include
using namespace std;...
分类:
其他好文 时间:
2015-02-02 23:14:33
阅读次数:
181
Tree RecoveryTime Limit:1000MSMemory Limit:65536KTotal Submissions:11939Accepted:7493DescriptionLittle Valentine liked playing with binary trees very ...
分类:
其他好文 时间:
2015-02-02 21:27:38
阅读次数:
140
在原生Android下编译APK,编译没有问题,但是在运行的时候经常出现如标题所描述的异常,然后整个程序Crash掉...... 我遇到该问题常常都是因为修改了资源文件所引起,大致有以下几种方式来解决: 1. 引用类名问题:自定义了一个View,将他用于布局文件中,假设他的包名叫MyPackage,...
分类:
移动开发 时间:
2015-02-02 19:52:17
阅读次数:
162
错误打印部分代码:
android.view.InflateException: Binary XML file line #8: Error inflating class
02-02 11:43:11.420: E/AndroidRuntime(25333): at android.view.LayoutInflater.createView(LayoutInflater.java...
分类:
移动开发 时间:
2015-02-02 14:18:18
阅读次数:
174
平衡二叉树(Balanced binary tree)是由阿德尔森-维尔斯和兰迪斯(Adelson-Velskii and Landis)于1962年首先提出的,所以又称为AVL树。
定义:平衡二叉树或为空树,或为如下性质的二叉排序树:
(1)左右子树深度之差的绝对值不超过1;
(2)左右子树仍然为平衡二叉树.
平衡因子BF=左子树深度-右子树深度....
分类:
其他好文 时间:
2015-02-02 12:37:55
阅读次数:
343
原题地址基本二叉树遍历代码:1 int minDepth(TreeNode *root) {2 if (!root)3 return 0;4 5 int l = root->left ? minDepth(root->l...
分类:
其他好文 时间:
2015-02-02 12:30:43
阅读次数:
96
原题地址参考了这篇博文的想法代码: 1 int balancedp(TreeNode *root) { 2 if (!root) 3 return 0; 4 5 int l = balancedp(root->left); 6 int r = balancedp(root->r...
分类:
其他好文 时间:
2015-02-02 12:29:53
阅读次数:
113
原题地址二叉树的遍历代码:1 int maxDepth(TreeNode *root) {2 if (!root)3 return 0;4 return max(maxDepth(root->left), maxDepth(root->righ...
分类:
其他好文 时间:
2015-02-02 12:21:50
阅读次数:
132
原题地址二叉树的层次遍历代码: 1 vector > levelOrder(TreeNode *root) { 2 vector > res; 3 queue layer; 4 5 layer.push(root); 6 ...
分类:
其他好文 时间:
2015-02-02 12:17:03
阅读次数:
171