Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-10-01 13:35:41
阅读次数:
233
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".补充说明:单词是指空格之间的字符序列。输入中可能有首部或尾部...
分类:
其他好文 时间:
2014-10-01 13:10:51
阅读次数:
161
array的方法总结会更改原来的的数组push、unshift方法,返回length。增加值得就返回length,其他返回该元素pop,shift返回该元素reverse返回该元素splice(start,deleteCount,addItem...),从原数组中删除和增加,返回删除的数组不会改变原...
分类:
其他好文 时间:
2014-09-30 20:02:00
阅读次数:
185
??
操作Collection以及Map的工具类:Collections
reverse(List):反转 List 中元素的顺序
shuffle(List):对 List 集合元素进行随机排序
sort(List):根据元素的自然顺序对指定 List 集合元素按升序排序
sort(List,Comparator):根据指定的 Comparator 产生的顺序对 List 集合元素进行排...
分类:
其他好文 时间:
2014-09-30 12:30:39
阅读次数:
202
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 digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-09-30 04:40:32
阅读次数:
182
题目描述:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321解题方案:该题比较简单,直接贴代码: 1 class Solution { 2 public: 3 int ...
分类:
其他好文 时间:
2014-09-29 23:48:01
阅读次数:
164
实现将一个句子中的单词全部翻转。例:“I am a boy”转“bvoid reverse(char *start, char *end){if(start==NULL || end==NULL)return; while(start<end){ char temp=*start...
分类:
其他好文 时间:
2014-09-29 12:50:30
阅读次数:
112
代码如下: template void reverse(It begin, It end)
{ while(begin != end) { --end; if(begin != end) std::swap(*begin++, *end); }
} 注意几点: 1.不能一开始...
分类:
其他好文 时间:
2014-09-28 21:37:45
阅读次数:
232
字符串循环移位:假设有一串字符串a,b,c,d,e,f,g,h,向左循环移位2为,得c,d,e,f,g,h,a,b。
#include
using namespace std;
void reverse(char* a, int start, int len){
int count = 0;
for(int i = start, j = start + len -1; ; ++i, --...
分类:
其他好文 时间:
2014-09-28 12:28:20
阅读次数:
140
题目描述:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another ex...
分类:
其他好文 时间:
2014-09-28 11:27:51
阅读次数:
164