题目:给定两个串s1和s2,对s1串,我们可以将其分割成两部分,这两部分都不为空,而被分割成的两部分,又可以递归的进行分割,直到不能进行分割为止,也就是只有一个字符的时候,就不在分割了。问s2是否由s1的这种分割表示中,某步分割成的两部分交换得到的。这种交换可以在不同的分割点进行多次。
/* s1
|__________p____________| ...
分类:
其他好文 时间:
2014-06-05 11:09:06
阅读次数:
207
Given a strings1, we may represent it as a
binary tree by partitioning it to two non-empty substrings recursively.Below is
one possible representation...
分类:
其他好文 时间:
2014-06-04 20:11:38
阅读次数:
303
【题目】
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ gr eat
/ \ / g r e at
/ ...
分类:
其他好文 时间:
2014-06-01 09:41:05
阅读次数:
196
Given a strings1, we may represent it as a
binary tree by partitioning it to two non-empty substrings recursively.Below is
one possible representation...
分类:
其他好文 时间:
2014-05-26 11:24:36
阅读次数:
214
5道题目分别是:【Combinations】、【Search a 2D Matrix】、【Scramble String 】、【Rotate List 】、【Partition List】,由于有一些题目不需要发一整篇博文来记录,所以就将这些题目以一篇博文5道来记录。...
分类:
其他好文 时间:
2014-05-20 15:36:16
阅读次数:
293
class Solution {public: bool isScramble(string
s1, string s2) { int len = s1.length(); if (len == 1 && s1[0] == s2[0])
return true; ...
分类:
其他好文 时间:
2014-05-16 00:38:48
阅读次数:
317
字符串的好题。题干解释的非常复杂,一下让人不知所措了。
这道题到底是什么意思呢?最终的结果是把一个字符串中字母的顺序打乱了,让你判断一个字符串能不能由另一个字符串打乱得到。那打乱这个过程是怎么做的呢,很简单,给你一个字符串,你必须先找一个点把它砍成两半,你可以通过交换这两半的顺序来打乱源字符串的顺序,也就是在两半中的字符与另一半中所有字符的相对顺序是统一的。对于每一半,都可以重复上面的过程。
...
分类:
其他好文 时间:
2014-05-09 20:59:46
阅读次数:
239