Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-08-03 22:14:10
阅读次数:
172
/*
* 带头节点
*/
ListNode * reverse(ListNode *head) {
if (head == NULL || head->next == NULL)
return head;
ListNode nhead(-1);//头节点
nhead.next = head;
ListNode *prev = head;
ListNode *n...
分类:
其他好文 时间:
2015-08-02 23:29:04
阅读次数:
225
1 #include 2 3 using namespace std; 4 //交换的函数 5 void replaced(int &a,int &b){ 6 int t = a; 7 a = b; 8 b = t; 9 }10 //反转11 void reversed...
分类:
编程语言 时间:
2015-08-02 19:57:08
阅读次数:
165
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-08-02 19:52:11
阅读次数:
94
sorted >>>?help(sorted)
Help?on?built-in?function?sorted?in?module?__builtin__:
sorted(...)
????sorted(iterable,?cmp=None,?key=None,?reverse=False)?-->?new?sorted?list list.sor...
分类:
编程语言 时间:
2015-08-02 16:57:06
阅读次数:
216
Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?Solution 1:iteration 1 /**...
分类:
其他好文 时间:
2015-08-02 14:57:55
阅读次数:
117
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represen...
分类:
其他好文 时间:
2015-08-01 23:36:18
阅读次数:
145
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C prog...
分类:
其他好文 时间:
2015-08-01 21:59:34
阅读次数:
122
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2015-08-01 21:45:38
阅读次数:
89
The material from Youtube:https://www.youtube.com/watch?v=PJzgqT2Ujek 1 public static ListNode reverse(ListNode head) { 2 if (head == null || ...
分类:
其他好文 时间:
2015-08-01 11:18:23
阅读次数:
96