码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
每日算法之二十:Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()...
分类:其他好文   时间:2014-06-05 02:15:14    阅读次数:262
LeetCode:Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…   You must do this in-place without altering the nodes' values.   For example, Given {1,2,3,4}, r...
分类:其他好文   时间:2014-06-03 03:12:46    阅读次数:222
系统观察命令sar常用输出选项说明
sar是linux系统下一个非常有用的系统观察命令,可以观察磁盘io,cpu,块设备,内存,swap等各种信息帮助我们审核操作系统的状况。下面列举了一些常用的系统状况查看命令。 sar -b:磁盘的IO传输统计     默认会显示5个值: tps:每秒发送给物理设备的io总数,其值等于rtps+wtps rtps:每秒读io请求总数 wtps:每秒写io请求总数 ` bread/s...
分类:其他好文   时间:2014-06-03 02:19:14    阅读次数:251
LeetCode: Partition List [086]
【题目】 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. For example, Given 1->4->3-...
分类:其他好文   时间:2014-06-03 00:02:29    阅读次数:270
leetcode -day24 Maximum Depth of Binary Tree & Binary Tree Zigzag Level Order Traversal
1、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 leaf node. clas...
分类:其他好文   时间:2014-06-02 23:13:22    阅读次数:290
JSON数据格式
http://blog.csdn.net/ninibinbin/article/details/3445936[ { "Id": "A", "Name": "A", "Nodes": { "Id": "A01", ...
分类:Web程序   时间:2014-06-02 13:31:12    阅读次数:287
LeetCode: Binary Tree Inorder Traversal [094]
【题目】 Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,3,2]. Note: Recursive solution is trivial, could you do it iteratively? confused what "{1,#,2...
分类:其他好文   时间:2014-06-01 13:01:23    阅读次数:279
每日算法之二十二:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space....
分类:其他好文   时间:2014-06-01 10:41:23    阅读次数:242
每日算法之二十三:Reverse Nodes in k-Group
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-06-01 09:05:42    阅读次数:271
LeetCode: Remove Duplicates from Sorted List II [083]
【题目】 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1->1->2->3, return 2->3. 【题意】 给定一个有序链表,删出其中重复出现的值...
分类:其他好文   时间:2014-05-31 21:14:11    阅读次数:333
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!