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 and the nodes have the same value.
分析:
题目要求判...
分类:
其他好文 时间:
2015-05-14 14:19:07
阅读次数:
124
题目:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and...
分类:
其他好文 时间:
2015-05-14 13:35:24
阅读次数:
129
题目:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For ...
分类:
其他好文 时间:
2015-05-14 11:43:09
阅读次数:
129
题目:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,...
分类:
其他好文 时间:
2015-05-14 11:23:11
阅读次数:
100
Maximum Depth of Binary Tree
Total Accepted: 63668 Total Submissions: 141121 My Submissions
Question Solution Given a binary tree, find its maximum depth.The maximum depth is the number of nodes...
分类:
其他好文 时间:
2015-05-13 23:19:39
阅读次数:
302
题目:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]...
分类:
其他好文 时间:
2015-05-13 23:12:07
阅读次数:
113
题目描述:
everse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as00...
分类:
其他好文 时间:
2015-05-13 22:07:09
阅读次数:
217
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 and the nodes have the same value./**
* Definition...
分类:
其他好文 时间:
2015-05-13 22:02:26
阅读次数:
156
最近想写一些关于红黑树的博客,既想写的全面,又直观,但是又不知道从哪里入手。斟酌再三,还是从最简单的二叉排序树开始写。
二叉排序树(Binary Sort Tree)又叫二叉查找树。它是一种特殊结构的二叉树。其或为空树,或具备下列性质:
(1)若它的左子树不为空,则左子树上所有结点的值均小于它的根节点的值。
(2)若它的右子树不为空,则左子树上所有结点的值均大于它的根节点的值。
显然,它的...
分类:
编程语言 时间:
2015-05-13 22:00:17
阅读次数:
208
题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N...
分类:
其他好文 时间:
2015-05-13 21:39:39
阅读次数:
126