码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
LeetCode--Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [3,2,1]. Note: Recursive solut...
分类:其他好文   时间:2015-01-15 13:00:56    阅读次数:141
二叉树的定义
/** class for nodes used in a binary tree */package dataStructures;public class BinaryTreeNode { // package visible data members Object element;...
分类:其他好文   时间:2015-01-15 10:47:12    阅读次数:206
二叉树的遍历
二叉树的前序,中序,后序,层次遍历/** binary tree traversal methods */package dataStructures;public class BinaryTreeTraversal { /** visit method that prints the ele...
分类:其他好文   时间:2015-01-15 10:37:52    阅读次数:230
LeetCode--Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find the tota...
分类:其他好文   时间:2015-01-15 09:26:49    阅读次数:117
BCD码与十进制
BCD码(Binary-Coded Decimal?)亦称二进码十进数或二-十进制代码。用4位二进制数来表示1位十进制数中的0~9这10个数码。是一种二进制的数字编码形式,用二进制编码的十进制代码。BCD码这种编码形式利用了四个位元来储存一个十进制的数码,使二进制和十进制之间的转换得以快捷的进行。这种编码技巧最常用于会计系统的设计里,因为会计制度经常需要对很长的数字串作准确的计算。相对于一般的浮点...
分类:其他好文   时间:2015-01-15 00:32:42    阅读次数:188
[C++]LeetCode: 94 Sum Root to Leaf Numbers (先序遍历)
题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find...
分类:编程语言   时间:2015-01-14 22:59:16    阅读次数:431
[C++]LeetCode: 95 Binary Tree Preorder Traversal (先序遍历)
题目: Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,2,3]. Note: Recursive...
分类:编程语言   时间:2015-01-14 22:59:13    阅读次数:174
Tree
Tree 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描述Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital lett...
分类:其他好文   时间:2015-01-14 22:56:51    阅读次数:231
[leetcode]Flatten Binary Tree to Linked List
问题描述: Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / 2 5 / \ 3 4 6 The flattened tree should look like: ...
分类:其他好文   时间:2015-01-14 22:54:05    阅读次数:158
[leetcode] 98 Validate Binary Search Tree
问题描述: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node'...
分类:其他好文   时间:2015-01-14 22:53:40    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!