One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the...
分类:
其他好文 时间:
2014-12-16 20:51:37
阅读次数:
272
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the...
分类:
其他好文 时间:
2014-12-16 10:05:45
阅读次数:
144
1.HTOP用途:用于linux上进行进程的管理,提供完整的进程列表,彩色标识出处理器、swap和内存状态。其中F1:帮助F2:设定F3:搜索进程F4:增量进程F5:树状结构显示F6:选择排序方式F7:减少进程优先级F优先级8:增加进程F9,:对进程输入信号,F10,:退出htop,常用命令:u:选..
分类:
系统相关 时间:
2014-12-16 06:35:20
阅读次数:
272
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 leaf node.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-12-15 21:52:22
阅读次数:
124
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is...
分类:
其他好文 时间:
2014-12-15 21:46:00
阅读次数:
229
Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).Fo...
分类:
其他好文 时间:
2014-12-15 18:59:13
阅读次数:
148
Kth Largest ElementFind K-th largest element in an array.NoteYou can swap elements in the arrayExampleIn array[9,3,2,4,8], the 3th largest element is ...
分类:
其他好文 时间:
2014-12-15 15:06:10
阅读次数:
338
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41929059
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
...
分类:
其他好文 时间:
2014-12-15 09:04:30
阅读次数:
137
链表的倒转,
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
/**
* Definition for singly-link...
分类:
其他好文 时间:
2014-12-14 00:46:14
阅读次数:
193
题目 Binary Tree Level Order Traversal II通过率30.6%难度EasyGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from ...
分类:
其他好文 时间:
2014-12-13 23:17:56
阅读次数:
150