码迷,mamicode.com
首页 >  
搜索关键字:binary tree right si    ( 32903个结果
关于margin-right的应用问题
今天在群里面,有人抛出了一个关于css中margin-right没有效果的问题。CSS代码和HTML代码如下: .style1{ width:400px; height:440px; background-color:red; border:5px solid silver; margin-top:20%; margin-right:30%; }...
分类:其他好文   时间:2014-06-08 17:38:27    阅读次数:204
Unique Binary Search Trees
题目 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 ...
分类:其他好文   时间:2014-06-08 17:06:58    阅读次数:235
Binary Tree Inorder Traversal
1. 递归解法 /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cl...
分类:其他好文   时间:2014-06-08 16:51:59    阅读次数:199
HDU 1394 Minimum Inversion Number Segment Tree解法
本题有两个考点: 1 求逆序数的性质 计算逆序数的公式, 一个数arr[i]从前面放到后面,必然会有n-arr[i]-1个数比这个大,那么就有n-arr[i]-1个逆序数增加,同时因为前面少了个arr[i]数,那么就必然有arr[i]个(加上零)数比起小的数失去一个逆序数,总共失去arr[i]个逆序数,所以新的逆序数为增加了n-arr[i]-1-arr[i]个逆序数(当然有可能是减小了,视ar...
分类:其他好文   时间:2014-06-08 15:52:20    阅读次数:275
LeetCode: Populating Next Right Pointers in Each Node II [117]
【题目】 Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constant extra space. For example, Given the following binary tre...
分类:其他好文   时间:2014-06-08 15:46:22    阅读次数:303
Recover Binary Search Tree
题目 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Cou...
分类:其他好文   时间:2014-06-08 15:32:45    阅读次数:245
Leetcode: Text Justification. java
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that i...
分类:编程语言   时间:2014-06-08 15:25:00    阅读次数:282
Unique Binary Search Trees II
题目 Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. ...
分类:其他好文   时间:2014-06-08 15:15:26    阅读次数:223
Binary Tree Preorder Traversal
1. 递归解法 2. 非递归解法(空间复杂度O(n)和O(1))...
分类:其他好文   时间:2014-06-08 10:47:37    阅读次数:139
android精确绘制文字位置的方法
android 中使用Canvas的drawText绘制文本的位置,是基于基线的。如下图: 其中字母Q的小尾巴在横线下面了。 怎么样找准字母的中心位置呢? 先看下面的例子:(右边的数字,表示字体的 left, top, right, bottom) 这里面的关键是Paint.getTextBound。 getTextBound会填充一个Rect,这个Rect表示...
分类:移动开发   时间:2014-06-08 09:08:44    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!