码迷,mamicode.com
首页 >  
搜索关键字:reverse    ( 5099个结果
Leetcode: Reverse Nodes in k-Group
链表的倒转, /** * 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
反序链表
题目: Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K = 3, then you must output 3→2...
分类:其他好文   时间:2014-12-13 21:53:24    阅读次数:326
java native2ascii的用法介绍
将非Unicode编码字符转化为Unicode编码的字符,即国际化。 语法:native2ascii [options] [inputfile [outputfile]] 描述:如果outputfile没有指定,标准输出将用于结果输出;如果inputfile没有指定,标准输入设备将用于输入。 参数 -reverse 使用该参数将Unicode编码字符转换为本地编码...
分类:编程语言   时间:2014-12-13 17:56:12    阅读次数:414
HappyLeetcode1 Reverse Words in a String
HappyLeetcode1:Reverse Words in a String题目描述:题目思考:建立一个数组,每个数组存储一个单词。将该数组倒序输出,每输出一个单词后,紧跟着输出一个空格。题目解题代码Pythonclass Solution: # @param s, a string # @re...
分类:移动开发   时间:2014-12-13 17:49:10    阅读次数:219
leetcode------Reverse Integer
标题:Reverse Integer正确率:34.8%难度简单Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here...
分类:其他好文   时间:2014-12-12 23:33:08    阅读次数:214
【LeetCode】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 ...
分类:其他好文   时间:2014-12-12 19:06:05    阅读次数:133
Add Two Numbers -- leetcode
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...
分类:其他好文   时间:2014-12-12 15:01:52    阅读次数:137
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 si...
分类:其他好文   时间:2014-12-11 15:35:50    阅读次数:124
ruby和linux shell共同编程的示例
有了shell为毛还要ruby呢?话不能这么说,有些小功能用ruby还是很方便的,比如说字符串的反转再加1功能用shell来写就比较麻烦.str="123456",我们定义一个反转后再+1的小方法: 2.1.5 :020 > class String 2.1.5 :021?> def r_add_1 2.1.5 :022?> replace reverse.each_byte.map...
分类:系统相关   时间:2014-12-11 12:27:20    阅读次数:250
【SICP读书笔记(四)】练习2.27 --- 表序列reverse的扩展:树结构的deep-reverse
题目要求是,修改练习2.18所做的reverse过程,得到一个deep-reverse过程。它以一个表为参数,返回另一个表作为值,结果表中的元素反转过来,其中的子树也反转。例如:(define x (list (list 1 2) (list 3 4)))x((1 2) (3 4))(reverse...
分类:其他好文   时间:2014-12-10 17:45:27    阅读次数:131
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!