jdk的方法:1 String str = “abcdef”; 2 str = new StringBuilder(str).reverse().toString();自己实现: 1 public class StringDemo{ 2 public static void main(Str...
分类:
其他好文 时间:
2015-09-07 19:36:18
阅读次数:
208
1 ??网络编程书籍 Books by Richard Stevens (reverse chronological) UNIX Network Programming, Volume 2, Second Edition: Interprocess Communications, Prentice Hall, 1999. ? UNIX Network Programming...
分类:
其他好文 时间:
2015-09-07 18:10:51
阅读次数:
223
练习1-19 编写函数reverse(s),将字符串s中的字符顺序颠倒过来。使用该函数编写一个程序,每次颠倒一个输入行中的字符顺序。代码如下:#include // 包含标准库的信息。#define MAXLINE 10 // 每行最大字符数为1000个。int ...
分类:
编程语言 时间:
2015-09-07 00:26:14
阅读次数:
266
1. Convert Expression to Reverse Polish Notation http://www.lintcode.com/en/problem/convert-expression-to-polish-notation/ Given an expression string ...
分类:
编程语言 时间:
2015-09-05 22:03:18
阅读次数:
315
Reverse Voltage ProtectionReverse Voltage ProtectionI've long wanted to pull together some reverse polarity protection ideas in one place. Many are fo...
分类:
其他好文 时间:
2015-09-05 17:40:25
阅读次数:
400
解法1:/** * Definition of ListNode * * class ListNode { * public: * int val; * ListNode *next; * * ListNode(int val) { * this->val...
分类:
其他好文 时间:
2015-09-04 21:09:32
阅读次数:
111
最近在搞新加坡的NOI2012的题,其中第二题Pancake可以用BFS解决,不过现在正在研究盖茨的《Bounds For Sorting By Prefix Reverse》,等研究出来一些成果会发布。目前能搞定的是BFS算法, 好在n最大为8,枚举量最多为8!,虽说有每个测试点可能有60...
分类:
其他好文 时间:
2015-09-03 21:40:09
阅读次数:
199
Reverse a singly linked list. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ...
分类:
其他好文 时间:
2015-09-03 16:29:02
阅读次数:
186
Problem:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another...
分类:
其他好文 时间:
2015-09-03 11:34:12
阅读次数:
141
1sort()按字母或者数字的升序排列ksort()按数组元素的键升序排序asort()按数组元素的值升序排序2对应的反向排序rsort();ksort();arsort()3shuffle()对数组元素进行动态排序array_reverse()给出一个原来数组的反向排序4array_push()将每个新元素添加到数组的末尾。array_pop()删..
分类:
编程语言 时间:
2015-09-02 02:17:52
阅读次数:
158