码迷,mamicode.com
首页 >  
搜索关键字:nodes    ( 4030个结果
javascript 哈夫曼树构造
function Node(data) { this.data = data; this.left = null; this.right = null; } /*测试用例*/ var datasarray = [1, 54, 23, 64, 53, 87, 97]; function createHufuTree(datasarray) { var nodes = []; /...
分类:编程语言   时间:2014-10-19 11:38:02    阅读次数:169
Implement Insert and Delete of Tri-nay Tree
Implement insert and delete in a tri-nary tree. A tri-nary tree is much like a binary tree but with three child nodes for each parent instead of two -...
分类:其他好文   时间:2014-10-19 02:40:16    阅读次数:236
LeetCode Binary Tree Level Order Traversal
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,9,2...
分类:其他好文   时间:2014-10-19 01:21:45    阅读次数:204
Maximum Depth of Binary Tree | LeetCode
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2014-10-18 20:57:37    阅读次数:229
NYOJ129 树的判定 【并查集】
树的判定 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描述 A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edge...
分类:其他好文   时间:2014-10-17 09:23:24    阅读次数:172
[leetcode]Binary Tree Level Order Traversal II
【题目】 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#...
分类:其他好文   时间:2014-10-16 18:00:42    阅读次数:245
PAT 1021 Deepest Root
#include #include #include using namespace std;class Node {public: vector adj; bool visited; Node() : visited(false) {}};void reset_nodes(vec...
分类:其他好文   时间:2014-10-16 13:06:32    阅读次数:171
[Leetcode] Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2014-10-16 06:33:22    阅读次数:238
[LeetCode]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: Recu...
分类:其他好文   时间:2014-10-15 23:57:11    阅读次数:229
leetcode - Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. class Solution { public: ListNode *mergeTwoLists(Li...
分类:其他好文   时间:2014-10-15 15:48:31    阅读次数:127
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!