码迷,mamicode.com
首页 >  
搜索关键字:binary tree upside d    ( 23249个结果)
5 Convert Sorted List to Binary Search Tree_Leetcode
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.这题和sort list等题都比较相似,需要先用快慢指针的方法找到链表的中点,然后...
分类:其他好文   时间:2014-10-16 22:31:43    阅读次数:217
由浅入深探究mysql索引结构原理、性能分析与优化(转)
add by zhj:原文链接已经失效了,网上看到的都是转载,向作者Benwin致敬摘要:第一部分:基础知识第二部分:MYISAM和INNODB索引结构1、简单介绍B-tree B+ tree树2、MyisAM索引结构3、Annode索引结构4、MyisAM索引与InnoDB索引相比较第三部分:MY...
分类:数据库   时间:2014-10-16 19:58:23    阅读次数:367
MySQL索引背后的数据结构及算法原理(转)
目录摘要数据结构及算法基础 索引的本质 B-Tree和B+Tree 为什么实用B-Tree(B+Tree)MySQL索引实现 MyISAM索引实现 InnoDB索引实现索引使用策略及优化 示例数据库 最左前缀原理与相关优化 索引选择性与前缀索引 InnoDB的主键选择与插入优化后记参考文献摘要本文以...
分类:数据库   时间:2014-10-16 19:36:23    阅读次数:377
[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
HDU 5044 Tree
树链剖分...
分类:其他好文   时间:2014-10-16 16:28:12    阅读次数:184
POJ 3321 Apple Tree DFS序+fenwick
题目大意:有一颗长满苹果的苹果树,有两个操作。 1.询问以一个点为根的子树中有多少个苹果。 2.看看一个点有没有苹果,如果没有苹果,那么那里就马上长出一个苹果(= =!);否则就把那个苹果摘下来。 思路:进行一次深搜,将每个节点最开始出现的时间和最后出现的时间记在一个数组里,那么这两点之间的点就是它以及它的子树的二倍,然后就用树状数组来维护区间和就行了。 CODE: ...
分类:移动开发   时间:2014-10-16 12:08:52    阅读次数:200
HDU 3333 Turing Tree(树状数组离线处理)
HDU 3333 Turing Tree 题目链接 题意:给定一个数组,每次询问一个区间,求出这个区间不同数字的和 思路:树状数组离线处理,把询问按右端点判序,然后用一个map记录下每个数字最右出现的位置,因为一个数字在最右边出现,左边那些数字等于没用了,利用树状数组进行单点修改区间查询即可 代码: #include #include #include #inc...
分类:编程语言   时间:2014-10-16 11:18:12    阅读次数:220
分形之二叉树(Binary Tree)
上一篇文章讲的是分形之树(Tree),这一篇中将其简化一下,来展示二叉分形树的生长过程。核心代码:static void FractalBinaryTree(const Vector3& vStart, const Vector3& vEnd, Yreal angle, Yreal branch_c...
分类:其他好文   时间:2014-10-16 09:43:02    阅读次数:397
[Leetcode] 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 an...
分类:其他好文   时间:2014-10-16 08:40:12    阅读次数:131
[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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!