不甚知道意义的题目,不过数组reverse值得复习一下哟public class Solution { public void nextPermutation(int[] num) { //这个题目意义何在啊唉 if (num==null || nu...
分类:
其他好文 时间:
2015-06-02 06:49:17
阅读次数:
108
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
代码如下:
class Solution {
public:
int reverse(int x) {
if (x == -x)
{
return 0;
}
if (x < ...
分类:
其他好文 时间:
2015-06-02 00:32:52
阅读次数:
112
更多实例合并两个数组 - concat()合并三个数组 - concat()用数组的元素组成字符串 - join()删除数组的最后一个元素 - pop()数组的末尾添加新的元素 - push()将一个数组中的元素的顺序反转排序 - reverse()删除数组的第一个元素 - shift()从一个数组...
分类:
编程语言 时间:
2015-06-02 00:18:00
阅读次数:
107
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321测试用例:123………………321-123………………-3211200………………2145134543545…………0(ove...
分类:
其他好文 时间:
2015-06-01 22:11:45
阅读次数:
123
刚开始并未考虑越界的问题,以及当个位数是0时会造成程序的错误,经过仔细审视,AC代码:int reverse(int x){ int res = 0; int temp = abs(x); int flag = 0; if (x=0 && yu>=0) { ...
分类:
其他好文 时间:
2015-06-01 18:20:02
阅读次数:
103
No.2 Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nod...
分类:
其他好文 时间:
2015-06-01 18:14:15
阅读次数:
111
Reverse Linked ListReverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could y...
分类:
编程语言 时间:
2015-05-30 16:31:55
阅读次数:
287
Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a...
分类:
编程语言 时间:
2015-05-30 07:02:44
阅读次数:
144
这道题不考虑越界问题的话,最粗暴的解法public class Solution { public int reverse(int x) { int rev =0; while(x!=0){ rev =rev*10+x%10; ...
分类:
其他好文 时间:
2015-05-29 06:09:45
阅读次数:
200
#include #include #include void reverse(char *p1,char *p2,int col){ int i; p2--; for(i=0;i<col/2;i++) { char t; t = *p1; ...
分类:
编程语言 时间:
2015-05-28 22:56:08
阅读次数:
141