码迷,mamicode.com
首页 >  
搜索关键字:二叉树.binary tree    ( 18099个结果
Same Tree
问题描述: 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. 解题思路:...
分类:其他好文   时间:2014-08-01 13:48:11    阅读次数:183
c语言实现tree数据结构
该代码实现了tree的结构,依赖dyArray数据结构。有first一级目录,second二级目录。 dyArray的c实现参考这里点击打开链接  hashTable的c实现参考这里点击打开链接 下面是跨平台的数据类型定义 // // cpPlatform.h // dataStruct // // Created by hherima on 14-7-29. // Copyrigh...
分类:编程语言   时间:2014-08-01 13:46:21    阅读次数:279
浅析敏感词过滤算法(C++)
为了提高查找效率,这里将敏感词用树形结构存储,每个节点有一个map成员,其映射关系为一个string对应一个TreeNode。STL::map是按照operator 2 #include 3 //#include 4 using namespace std; 5 6 7 class Tree...
分类:编程语言   时间:2014-08-01 13:31:41    阅读次数:486
POJ 2828Buy Tickets
POJ 2828题目大意是说有n个插入操作,每次把B插入到位置A,原来A以后的全部往后移动1,球最后的序列tree里保存的应该是这整个区间还有多扫个位置可以插入数据,那么线段树里从后往前扫描依次插入数据比如现在吧B插入到A位置,如果整个区间左侧还有>1; 6 7 if(x 2 #incl...
分类:其他好文   时间:2014-08-01 13:31:31    阅读次数:177
二维树状数组
Mobile phoneshttp://poj.org/problem?id=1195 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 const int M=1030; 5 class Two_Tree_Array {...
分类:其他好文   时间:2014-08-01 13:03:01    阅读次数:168
delphi 文件或目录转换成 TreeView
//文件或目录转换成 TreeViewprocedure DirToTreeView(Tree: TTreeView; Directory: string; Root: TTreeNode; IncludeFiles:Boolean);varSearchRec: TSearchRec;ItemTem...
分类:其他好文   时间:2014-08-01 12:52:21    阅读次数:267
Sum Root to Leaf Numbers leetcode java
题目: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 w....
分类:编程语言   时间:2014-08-01 06:57:21    阅读次数:297
重拾算法(5)——最小生成树的两种算法及其对比测试
求解最小生成树(Minimum Cost Spanning Tree,以下简写做MST)是图相关的算法中常见的一个,本篇介绍两种求解MST的算法:Prim和Kruskal,然后测试之。
分类:其他好文   时间:2014-08-01 06:57:11    阅读次数:394
Construct Binary Tree from Inorder and Postorder Traversal Traversal leetcode java
题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解:这道题跟pre....
分类:编程语言   时间:2014-08-01 06:56:51    阅读次数:185
Construct Binary Tree from Preorder and Inorder Traversal leetcode java
题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解: 1 ...
分类:编程语言   时间:2014-08-01 06:56:41    阅读次数:228
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!