码迷,mamicode.com
首页 >  
搜索关键字:reverse    ( 5099个结果
leetcode_Add Binary
描述: Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 思路: 将字符串从后向前进行相加,最后有进位的话再创造新的位数,最后将字符串反转,输出即可。...
分类:其他好文   时间:2015-05-15 09:06:04    阅读次数:99
Leetcode第七题_Reverse Integer
Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321这题比较容易,就是把给的一个数,反顺序输出而已。直接对10取余数,把每一位数字读出来,再生成一个新的数就可以了,边界有一个溢出的问题,在这里,我选择的方法是定义一个long类型的变量,该变量...
分类:其他好文   时间:2015-05-14 23:51:33    阅读次数:161
LeetCoding--Reverse Linked List(Java)
翻转单链表(要注意的是是否含有头结点):思路一:每次将第一个节点后的那个节点放到第一个位置。若无头结点,则额外需要一个指针记录首节点。代码:/** * Definition for singly-linked list. * public class ListNode { * int val...
分类:编程语言   时间:2015-05-14 18:19:12    阅读次数:218
LeetCode:Reverse Bits
题目描述: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary a...
分类:其他好文   时间:2015-05-14 16:30:40    阅读次数:102
ngrok 部署本机代码,使外网可以访问
一什么是ngrok ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyzes ....
分类:其他好文   时间:2015-05-14 15:38:59    阅读次数:134
[LeetCode]Reverse Integer
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321考虑输入是abc,返回结果是cba,那么假设用除法(除以10)取余数操作的话,是先入先出的操作(第一次入abc%10=c),因...
分类:其他好文   时间:2015-05-14 13:50:40    阅读次数:96
leetcod--Reverse Bits
题目描述: everse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as00...
分类:其他好文   时间:2015-05-13 22:07:09    阅读次数:217
leetcode 7 Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers.Have you thought about this? Here are some good questions to ask before coding. Bonu...
分类:其他好文   时间:2015-05-13 21:49:54    阅读次数:235
rever_string()函数(递归实现)即递归实现字符串反转
一、实现功能: 将输入字符串abcde反转成edcba输出 二、代码 #include #include #include #define MAX_STR 10 void reverse_string(char * string) { int len = strlen(string); assert(string); if (len <= 1) { return;...
分类:其他好文   时间:2015-05-13 16:56:32    阅读次数:133
Palindrome Number
public class Solution { public boolean isPalindrome(int x) { if (x < 0) { return false; } return x == reverse(x); ...
分类:其他好文   时间:2015-05-13 12:19:59    阅读次数:68
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!