码迷,mamicode.com
首页 >  
搜索关键字:reverse    ( 5099个结果
九章算法面试题73 翻转链表II
九章算法官网-原文网址 http://www.jiuzhang.com/problem/74/ 题目 给一个链表,然后我们要把这个链表中第m个节点到第n个节点的部分翻转。 在线测试本题 http://www.lintcode.com/en/problem/reverse-linked-list-ii/ 解答 为更好处理表头和第m个节点,引入dummy结点,...
分类:编程语言   时间:2015-06-14 12:36:24    阅读次数:153
cocos2d-x 3.6版连连看开始界面
上一节讲了一个loading的动画界面,其实没有loading资源。 怎么样loading资源,如何预加载资源呢。直接上代码 // 创建一个一直重复的动画 loading->runAction(RepeatForever::create(Sequence::create(fadeIn, fadeIn->reverse() ,NULL))); // loading resources...
分类:其他好文   时间:2015-06-14 01:54:03    阅读次数:285
LeetCode Reverse Integer
最近开始刷刷的Leetcode题,遇到了一道这么一个简单的题 Reverse Integer ,然而并没有看上去的那么简单, 特殊的坑就如这道题说的 overflow ! 一开始天真的认为就是每个语言自己定义的最大整数,如 ? 在python中 >>...
分类:其他好文   时间:2015-06-13 10:03:52    阅读次数:132
算法-字符串反转
字符串反正工作中有的时候会遇到,其实跟之前的整数逆序输出是一个道理,当然实现的方法的有很多,有的人写的有七种,能实现就好,就常用的实现了两种,凑合着看下吧:Reverse.h@interface Reverse : NSObject-(void)reverse;-(NSString *)revers...
分类:编程语言   时间:2015-06-13 06:14:49    阅读次数:201
Leetcode[7]-Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321取一个数的最后一位,用x % 10,取一个数的前n-1位(共n位),用x/10,每一次取的时候,都将上一次取的数乘以10,然后再加上末尾的数即可,代码如下:Code(C++)class Solution { public...
分类:其他好文   时间:2015-06-12 23:55:44    阅读次数:178
[剑指OFFER] 从尾到头打印链表
题目描述输入一个链表,从尾到头打印链表每个节点的值。返回新链表的头结点。方法一:用stack,或者最好vector.reverse vector printListFromTailToHead(struct ListNode* head) { sta...
分类:其他好文   时间:2015-06-12 13:06:04    阅读次数:100
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 ...
分类:其他好文   时间:2015-06-11 16:45:25    阅读次数:88
python扩展
当python的基本功能无法满足要求,或者是为了保密源代码(.py)、遇到性能瓶颈时,我们常常要扩展python,扩展语言可以是C/C++、Java、C#等。为python创建扩展需要三个主要的步骤:创建应用程序代码;利用样板来包装代码;编译与测试。1、 创建应用程序代码 我们创建一个C代码PythonEx.c,实现两个函数fac()和reverse(),分别用来求阶乘和逆转字符串,test()函...
分类:编程语言   时间:2015-06-11 13:05:27    阅读次数:118
Leetcode[92]-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.Note: Given m, n satisfy the following co...
分类:其他好文   时间:2015-06-11 09:33:31    阅读次数:141
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 si...
分类:其他好文   时间:2015-06-10 23:52:05    阅读次数:131
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!