码迷,mamicode.com
首页 >  
搜索关键字:reverse    ( 5099个结果
数据结构练习 02-线性结构2. Reversing Linked List (25)
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,...
分类:其他好文   时间:2015-05-28 01:59:21    阅读次数:238
Solution to LeetCode Problem Set
Here is my collection of solutions to leetcode problems.LeetCode - Course ScheduleLeetCode - Reverse Linked ListLeetCode - Isomorphic StringsLeetCode ...
分类:其他好文   时间:2015-05-27 22:36:51    阅读次数:175
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 digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2015-05-27 21:10:51    阅读次数:137
js实现单向链表
add() 添加元素 clear() 清空链表 contains(data) 是否包含元素 display() 显示链表 get(position) 得到索引位置的元素 isEmpty() 链表是否为空 remove(position) 移除索引位置的元素 reverse() 倒置链表 set(position, data) 向链表指定位置设置修改元素 size() 返回链表的长度 var Node...
分类:Web程序   时间:2015-05-27 17:26:50    阅读次数:131
leetcode 7 -- Reverse Integer
Reverse Integer 题目: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 题意: 给你一个整型数,要求返回它的反转数,题目说的很清楚了,但是需要注意的一点就是整型溢出的情况,如果溢出我们返回0。 思路: 我偷懒了用...
分类:其他好文   时间:2015-05-26 18:52:05    阅读次数:109
leetcode_26题——Reverse Integer(int型的表示范围)
Reverse IntegerTotal Accepted:73207Total Submissions:281775My SubmissionsQuestionSolutionReverse digits of an integer.Example1:x = 123, return 321Exam...
分类:其他好文   时间:2015-05-26 15:58:48    阅读次数:124
LeetCode Reverse Integer (处理溢出)
这道题看上去比较简单,但是需要注意的细节和情况的处理还是很多的。 (1) 注意负数 (2)注意10,100这类数字的反转 (3) 最容易忽视的一点,整型的溢出。(2333333339反转超int) 注意我们计算的过程中不需要另外存数字,直接计算就好。处理溢出我们先用long long储存,超int后直接返回0 其实我们发现,(1)和(2)都不需要特殊处理,在运算的过程中会自行处理。 c...
分类:其他好文   时间:2015-05-26 09:18:36    阅读次数:97
数组常用方法
var arr=[];reverse 翻转顺序sort 排序concat 连接一个数组,并返回slice 返回制定数组的一个片段var a=[1,2,3,4,5];a.slice(0,3)//不包括末尾位置a.slice(3)a.slice(1,-1)a.slice(-3,-2)console.lo...
分类:编程语言   时间:2015-05-25 23:47:57    阅读次数:179
杭电oj1062 Text Reverse
Tips:使用一个临时数组c[1000] ,将输入的数据一边复制一边处理,碰到空格时就将前面的字符反向输出即可 1 #include 2 #include 3 ///使用一个临时数组c[1000] ,将输入的数据一边复制一边处理 4 void reverse(char s[]){ 5 cha...
分类:其他好文   时间:2015-05-25 22:22:37    阅读次数:163
No.206 Reverse Linked List
No.206 Reverse Linked ListReverse a singly linked list.单链表带头结点【leetcode判错】: 1 #include "stdafx.h" 2 3 struct ListNode 4 { 5 int val; 6 ListNo...
分类:其他好文   时间:2015-05-25 16:29:37    阅读次数:174
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!