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 nodes...
分类:
其他好文 时间:
2015-07-22 22:40:11
阅读次数:
119
一、题目Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321二、分析本题基本没有难度,用Python做这种数啊什么的最爽了,不用担心溢出的问题,并且字符串和整数间转换特别顺畅,像...
分类:
其他好文 时间:
2015-07-22 01:24:04
阅读次数:
158
class Solution {public: void reverseWords(string &s) { string::iterator it; int i=0; it= s.begin(); while(it!=s.end() && (*it==' ' || *it=='\t'))...
分类:
其他好文 时间:
2015-07-21 20:23:00
阅读次数:
92
You are giventwo linked lists representing two non-negative numbers. The digits are storedin reverse order and each of their nodes contain a single digit. Add the twonumbers and return it as a linked ...
分类:
其他好文 时间:
2015-07-21 12:53:28
阅读次数:
121
/*
Boolean CFStringTransform(CFMutableStringRef string, CFRange *range, CFStringRef transform, Boolean reverse);
其中string参数是要转换的string,比如要转换的中文,同时它是mutable的,因此也直接作为最终转换后的字符串。range是要转换的范围...
分类:
其他好文 时间:
2015-07-20 23:44:43
阅读次数:
189
2..5 You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the...
分类:
其他好文 时间:
2015-07-20 21:17:55
阅读次数:
192
反转单链表
1. 用数组将单链表的值存储在数组里。方法简单,但浪费空间。
2. 遍历链表,从第二个节点开始,将每个节点的next指向前一个节点。原链表的最后一个节点变为头节点。
3. 遍历链表,除第一个节点外,将每一个节点依次插到第一个节点后面。最后将第一个节点插到最后。
way 2 :
ListNode* reverse_1(ListNode* head){
L...
分类:
其他好文 时间:
2015-07-20 16:39:43
阅读次数:
96
//跟wyr学的//其实是贪心//题解稍后补上 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #include12 #de...
分类:
其他好文 时间:
2015-07-20 12:25:18
阅读次数:
229
题目链接:https://leetcode.com/problems/reverse-nodes-in-k-group/
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not...
分类:
其他好文 时间:
2015-07-19 18:04:26
阅读次数:
128
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-07-19 11:38:34
阅读次数:
122