原文:297. Serialize and Deserialize Binary Tree

题目: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link t ...

2015-12-15 07:16 0 3207 推荐指数:

查看详情

Binary TreeBinary Search Tree

Binary TreeDefinition: at most two children node. Binary Tree Example:                 10 ==root                / \               13 ...

Mon Jul 22 16:30:00 CST 2019 0 830
[Leetcode] Balanced Binary Tree

问题:给一个二叉树,写一个算法判断这个树是不是balanced。 Solution #1. 第一次遇到这个问题时我的解法,如下: 写了一个getDepth()函数,访问每个节点都要 ...

Sun May 04 08:58:00 CST 2014 2 6363
LeetCode Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which ...

Sun Oct 28 06:40:00 CST 2012 5 4228
Binary Indexed Tree

我借鉴了这个视频中的讲解的填坑法,我认为非常易于理解。有翻墙能力和基本英语听力能力请直接去看视频,并不需要继续阅读。 naive 算法 考虑一个这样的场景: 给定一个int数组, 我们想知道它的连 ...

Sun May 14 08:06:00 CST 2017 0 1487
[leetcode]Balanced Binary Tree @ Python

原题地址:http://oj.leetcode.com/problems/balanced-binary-tree/ 题意:判断一颗二叉树是否是平衡二叉树。 解题思路:在这道题里,平衡二叉树的定义是二叉树的任意节点的两颗子树之间的高度差小于等于1。这实际上是AVL树的定义。首先要写一个计算 ...

Sat May 10 18:54:00 CST 2014 0 5388
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM