码迷,mamicode.com
首页 >  
搜索关键字:reverse nodes    ( 8673个结果
Leetcode Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".此题要注意的几个情况是:(1)输入字符串可能含有前缀0和后缀...
分类:其他好文   时间:2014-06-28 22:51:26    阅读次数:261
could only be replicated to 0 nodes, instead of 1
1、检查空间是否够用(我的就是这个原因) df -hl 查看,如果可用的很少,那就是了。2、datanode是否正常启动 访问:50070,查看datanode的个数,如果不对应,重新启动3、是否在safemode下 hadoop dfsadmin -safemode get,查看,leave...
分类:其他好文   时间:2014-06-19 00:14:41    阅读次数:306
LeetCode解题报告:Binary Tree Postorder Traversal
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No...
分类:其他好文   时间:2014-06-18 17:32:02    阅读次数:168
[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-06-18 12:51:52    阅读次数:205
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 const...
分类:其他好文   时间:2014-06-18 11:53:39    阅读次数:138
[leetcode] 2. Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-06-17 23:38:04    阅读次数:341
leetcode -day30 Reverse Linked List II
1、 ?? Reverse Linked List II  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....
分类:其他好文   时间:2014-06-17 23:03:12    阅读次数:257
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 rem...
分类:其他好文   时间:2014-06-17 22:15:52    阅读次数:299
[LeetCode] Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Have you thought about this?Here are some good questions to ...
分类:其他好文   时间:2014-06-17 20:06:14    阅读次数:205
leetcode——Reverse Linked List II 选择链表中部分节点逆序(AC)
处理这个问题还是挺复杂的,需要考虑很多边界的测试用例。我总体的思路是先用循环标记m前一个节点和n后边一个节点,把n后边的节点首先作为当前逆转节点的pre,然后循环n-m次完成所选节点部分的逆序,然后将标记的m节点前一个节点指向逆序后部分的头节点即可。要考虑各种特殊情况,另外考虑即可。code如下:...
分类:其他好文   时间:2014-06-15 13:44:17    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!