div{ height:200px; color:#F00;}.left{ float:left;
width:100px; background:#00f; _margin-right:-3px;}.right{ float:right;
width:100px; background:#0f0;...
分类:
其他好文 时间:
2014-05-26 23:51:20
阅读次数:
401
习惯了直接在xml里设置margin(距离上下左右都是10dip),如:只是有些情况下,需要在java代码里来写。API中,android.view.ViewGroup.MarginLayoutParams有个方法setMargins(left,
top, right, bottom)。可是View...
分类:
移动开发 时间:
2014-05-26 23:51:05
阅读次数:
543
二叉树定义:每个结点最多有两个子树的树struct TreeNode { int val;
TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL),
right(NULL) {} };...
分类:
其他好文 时间:
2014-05-26 23:43:52
阅读次数:
351
原题地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/题意:
1 / \ 2 3 / \ / \ 4 5 6 7变为: ...
分类:
编程语言 时间:
2014-05-26 23:43:29
阅读次数:
332
算法:1.
对root的左子树做处理,让左子树的根节点作为,根节点的右子树,并让右子树作为左子树根节点的右子树的子树2. 递归遍历右子树public void
flatten(TreeNode root) { if(root==null){ return; ...
分类:
其他好文 时间:
2014-05-26 23:39:49
阅读次数:
253
H. Happy Reversal
64-bit integer IO format: %lld
Java class name: Main
Elfness is studying in an operation "NOT".
For a binary number A, if we do operation "NOT A", after that, all digit...
分类:
移动开发 时间:
2014-05-23 00:43:49
阅读次数:
430
问题:给定一个字符串,字符串中包含若干单词,每个单词间由空格分隔,将单词逆置,即第一个单词成为最后一个单词,一次类推。
说明:字符串本身可能包含前导空格或后导空格,单词间可能包含多个空格,要求结果中去掉前导和后导空格,单词间空格只保留一个。
与rotate函数类似,先逆置每个单词,再将所有字符串逆置。
void reverseWords(string &s) {
if(s.si...
分类:
其他好文 时间:
2014-05-22 18:49:26
阅读次数:
249
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-05-22 16:05:56
阅读次数:
239
1 #include 2 3 4 using namespace std; 5 6 void
Repeat(int* a,int Left,int Right); 7 int QuickSort(int* a,int Left,int Right); 8
9 10 void main()1...
分类:
其他好文 时间:
2014-05-22 14:53:10
阅读次数:
224
@Html.Label("Label", "Label")
@*渲染成Label*@@Html.Hidden("Hidden","Hidden") @*渲染成 *@@Html.TextBox("TextBox",
"TextBox", new { color="red",font="2",si...
分类:
Web程序 时间:
2014-05-22 14:49:43
阅读次数:
322