码迷,mamicode.com
首页 >  
搜索关键字:reverse intger    ( 5102个结果
Leetcode解题-链表(2.2.2)ReverseLinkedList
题目:2.2.2 Reverse Linked List IIReverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->nullptr, m = 2 and n = 4,return 1->4->3->2->5->nullptr.Note: ...
分类:其他好文   时间:2015-03-28 11:33:15    阅读次数:154
LeetCode OJ 190题:Reverse Bits
题目分析:常规解法,实在不知道如何优化了。 1 class Solution { 2 public: 3 uint32_t reverseBits(uint32_t n) 4 { 5 uint32_t m = 0; 6 for (uint32_t i...
分类:其他好文   时间:2015-03-28 11:20:17    阅读次数:101
Leetcode解题-链表(2.2.1)AddTwoNumbers
1 题目:2.2.1 Add Two NumbersYou 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 numbe...
分类:其他好文   时间:2015-03-28 08:48:00    阅读次数:185
一些Python知识点
0. 新与旧两种reverse>>> L = [1,2,3,4]>>> R = L[::-1] # new object>>> R[4, 3, 2, 1]>>> L.reverse() # in place>>> L[4, 3, 2, 1]>>>两种sort>>> sorted(r) # new o...
分类:编程语言   时间:2015-03-28 06:20:12    阅读次数:172
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:其他好文   时间:2015-03-28 01:04:10    阅读次数:151
翻转单词顺序 42
写一个翻转函数,使字符串倒叙 先把整个句子翻转 然后以空格为split,分割字符串 对单个字符再进行翻转,然后重新组合 package reverseSentence42; public class ReverseSentence42 { static String reverse(String s...
分类:其他好文   时间:2015-03-27 21:53:43    阅读次数:194
LeetCode Algorithm 07_Reverse Integer
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-03-22 06:49:21    阅读次数:131
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-03-21 21:08:04    阅读次数:177
LeetCode Algorithm 02
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-03-21 19:53:11    阅读次数:151
leetcode3--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-03-21 15:39:18    阅读次数:118
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!