Problem DescriptionMatt has N friends. They are playing a game together.Each of Matt’s friends has a magic number. In the game, Matt selects some (cou...
分类:
移动开发 时间:
2015-09-22 16:32:36
阅读次数:
207
描述In Yan Yuan, the Peking University campus, there are many homeless cats. They all live happy lives because students founded a Cat Association to tak...
分类:
其他好文 时间:
2015-09-20 14:38:14
阅读次数:
168
题目描述请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 1 void replaceSpace(char *str,int length) { 2 //新建一个数组st...
分类:
其他好文 时间:
2015-09-19 00:36:47
阅读次数:
220
题目描述请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。解题思路遍历字符串,遇到空格,就把空格后面的所有数后移两个位置;
空格处放’%’,空出来的两个位置放’2’,’0’代码实现class Solution {
public:
void replaceSpace(char *str,...
分类:
其他好文 时间:
2015-09-17 06:31:14
阅读次数:
168
题目描述请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。解题思路输入的是前序遍历及中序遍历的结果,如示例:
前序 : 1 2 4 7 3 5 6 8
中序 : 4 7 2 1 5 3 8 6前序遍历的第一个数肯定为root,然后分别构建它的左右子树
在中序遍历里找到它的前一个数,若无,则左...
分类:
其他好文 时间:
2015-09-16 14:20:34
阅读次数:
188
1、概述博主本想踏入游戏开放行业,无奈水太深,不会游泳;于是乎,只能继续开发应用,但是原生Android也能开发游戏么,2048、像素鸟、别踩什么来着;今天给大家带来一篇2048的开发篇,别怕不分上下文,或者1、2、3、4,一篇包你能玩happy~虽然我从来没有玩到过2048!!!其实大家也可以当作...
分类:
移动开发 时间:
2015-09-14 12:05:56
阅读次数:
218
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:
移动开发 时间:
2015-09-11 06:44:56
阅读次数:
159
Idea,一款比较出色的IDE开发工具,懂她的人,自然懂得。本版本-14.04+注册码注册界面注册码: Name:happy KEY:01762-T4HK8-EIPSJ-6EXNE-QQEUP-ECHQ5下载地址: http://yunpan.cn/cmG8...
分类:
其他好文 时间:
2015-09-10 22:27:15
阅读次数:
195
对并查集理解之后就可以做这种题了,虽说这种题做的不多,这道题做过才这么快搞定,可是还是挺happy滴,加油Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要...
分类:
其他好文 时间:
2015-09-10 19:32:57
阅读次数:
195
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:
移动开发 时间:
2015-09-10 08:25:48
阅读次数:
190