1、题目名称 Reverse Nodes in k-Group(分组翻转链表) 2、题目地址 https://leetcode.com/problems/reverse-nodes-in-k-group 3、题目内容 英文: Given a linked list, reverse the nodes of a linked list k ...
分类:
其他好文 时间:
2015-08-11 01:48:39
阅读次数:
169
题目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.Yo...
分类:
其他好文 时间:
2015-08-10 22:24:02
阅读次数:
118
>>> l = list('sdf')>>> l['s', 'd', 'f']>>> id(l)4520422000>>> l.reverse()>>> id(l)4520422000>>> l.extend(list('fff'))>>> id(l)4520422000>>> l.sort()>>...
分类:
其他好文 时间:
2015-08-10 19:29:56
阅读次数:
150
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 digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2015-08-10 00:24:55
阅读次数:
93
使用C/C++语言写一个函数,实现字符串的反转,要求不能用任何系统函数,且时间复杂度最小。函数原型是:char *reverse_str(char *str)#include char* reverse_str(char* str){ if(NULL == str) return...
分类:
其他好文 时间:
2015-08-10 00:01:08
阅读次数:
235
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som...
分类:
其他好文 时间:
2015-08-10 00:00:19
阅读次数:
403
Emag eht htiw Em Pleh
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 2994
Accepted: 1979
Description
This problem is a reverse case of the
problem 2996. Y...
分类:
其他好文 时间:
2015-08-09 22:31:12
阅读次数:
175
Reverse Bits leetcode解题报告...
分类:
其他好文 时间:
2015-08-09 14:13:34
阅读次数:
114
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321注意考虑几个情况,x=1534236460 1534236469 -2147483647等等。写的代码有点冗长了。 1 pub...
分类:
其他好文 时间:
2015-08-08 11:45:33
阅读次数:
118
题目要求:给定一个字符串由不同单词组成,返回其相反顺序,中间可能有多余字符:例如:Given s = "the sky is blue",return "blue is sky the".个人解法:1.暴力,主要是对于两个单词中间存在多个空格的处理。2. 利用栈来存储临时变量。3.缺点,空间利用太大...
分类:
其他好文 时间:
2015-08-07 07:05:41
阅读次数:
115