1、思路:将字符串转化为字符串数组,然后根据下标反向输出 public?void?reverse()?{
String?s?=?"hello";
char[]?c;
c?=?s.toCharArray();??//转化为字符串数组
for?(int?i?=?c.length?...
分类:
其他好文 时间:
2014-07-22 09:10:36
阅读次数:
446
The trick is, we can work on a reversed vector - learnt from EPI.class Solution {public: vector plusOne(vector &digits) { std::reverse(digit...
分类:
其他好文 时间:
2014-07-22 00:33:36
阅读次数:
223
今天发现自己连Bundle类都没有搞清楚,于是花时间研究了一下。依据google官方的文档(http://developer.android.com/reference/android/os/Bundle.html)Bundle类是一个key-value对,“A mapping from Strin...
分类:
移动开发 时间:
2014-07-22 00:33:35
阅读次数:
239
list
----------------------------------------------------------------------
??为什么很多在算法库里有的算法还要在类的成员函数里重新实现一遍?
-->1.因为算法库里的是通用的,对于具体的类来说效率不高。
比如说 reverse 如果直接用 stl_algo.h 里的 reverse,会再调用 iter_swap,
而 iter_swap 的实现方法是借用临时变量来交换两个迭代器指向的元素,这样会调用
好几次构造函数、拷贝方法、析构...
分类:
其他好文 时间:
2014-07-22 00:27:35
阅读次数:
357
1. 主键(id)? ? ? ? ?Hibernate的主键生成策略有如下几种:? 1) ?assigned? 主键由外部程序负责生成,在 save() 之前指定。? 2) ?hilo? 通过hi/lo 算法实现的主键生成机制,需要额外的数据库表或字段...
分类:
移动开发 时间:
2014-07-21 23:39:36
阅读次数:
475
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input:Digit st...
分类:
其他好文 时间:
2014-07-21 16:44:12
阅读次数:
191
public class Solution { public String reverseWords(String s) { String ans=reverse(s); String s2[]=ans.split("\\s+"); ...
分类:
其他好文 时间:
2014-07-21 08:20:33
阅读次数:
203
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
click to show spoilers.
Have you thought about this?
Here are some good questions to ask before c...
分类:
编程语言 时间:
2014-07-20 22:12:03
阅读次数:
251
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 ...
分类:
其他好文 时间:
2014-07-20 21:32:55
阅读次数:
250
如果你反过来看摩尔定理,一个 IT 公司如果今天和十八个月前卖掉同样多的、同样的产品,它的营业额就要降一半。IT 界把它称为反摩尔定理。
分类:
其他好文 时间:
2014-07-19 09:31:04
阅读次数:
230