比起POJ弱爆了一题,从后往前扫描一遍,O(n)时间,只要注意各种极端情况即可,不明白通过率为什么只有13%。
#include
#include
using namespace std;
class Solution {
public:
void reverseWords(string &s) {
char* cstr = new char[s.size()+1];
...
分类:
其他好文 时间:
2014-06-05 03:45:47
阅读次数:
221
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-04 18:55:07
阅读次数:
343
从SQL文件逆向工程到PDM:①选择file -> Reverse Engineer -
> Database②在General选项卡中选择MySQL数据库,点击确定。③using script file
选择你的sql文件,最后选择确定。从PDM转成CDM:①选择工具 -> General CDM...
分类:
数据库 时间:
2014-06-03 14:09:49
阅读次数:
363
原题地址:https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/题意:Evaluate
the value of an arithmetic expression inReverse Polish Notation.Val...
分类:
编程语言 时间:
2014-06-03 11:18:22
阅读次数:
335
原题地址:https://oj.leetcode.com/problems/reverse-words-in-a-string/题意:Given
an input string, reverse the string word by word.For example,Given s = "the s...
分类:
编程语言 时间:
2014-06-03 11:13:36
阅读次数:
258
Given an input string, reverse the string word
by word.For example,Given s = "the sky is blue",return "blue is sky the".click
to show clarification.Cl...
分类:
其他好文 时间:
2014-05-30 16:25:58
阅读次数:
233
Evaluate the value of an arithmetic expression
inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an
integer or another express...
分类:
其他好文 时间:
2014-05-30 15:22:39
阅读次数:
301
题目链接从代码的健壮性考虑,
应该顾及到把数字翻转后发生溢出的情况,但是此题中并没有这种测试数据。附上代码: 1 class Solution { 2 public: 3 int
reverse(int x) { 4 int tmp = abs(x); 5 i...
分类:
其他好文 时间:
2014-05-29 00:26:22
阅读次数:
243
原文地址:http://reverse.put.as/2012/02/02/anti-disassembly-obfuscation-1-apple-doesnt-follow-their-own-mach-o-specifications/当想到这个特性时,我非常高兴!因为我喜欢突破束缚,并且写了...
分类:
移动开发 时间:
2014-05-28 10:01:12
阅读次数:
353