string
fu_ding1991
勿忘初心,方得始终
展开
-
标准C++中的string类的用法总结
转载自:http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html 相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用。但是如果离开了MFC框架,还有没有这样使用起来非常方便的类呢?答案是肯定的。也许有人会说,即使不用MFC框架,也可以想办法使用M转载 2015-03-16 00:01:34 · 283 阅读 · 0 评论 -
Palindrome Partitioning&II(回文字符串)
题意:找出一个字符串中的所有切割使得切割后的子串都是回文字符串。首先想到一个简单的DP判断从i到j是否能组成回文。 设dp[i][j] = 1代表a[i]到a[j]组成的子串是回文,反之则不是。 转移方程:若dp[i+1][j-1] = 1且a[i] = a[j]则dp[i][j] = 1。 然后寻找所有切割可以使用DFS,深搜每个可能的分割。代码如下:class Solution { pub原创 2015-05-26 11:54:11 · 370 阅读 · 0 评论 -
Shortest Palindrome(KMP)
题意:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.For exampl原创 2015-05-27 15:18:55 · 618 阅读 · 0 评论 -
Interleaving String(动态规划求字符重构)
题意:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: s1 = “aabcc”, s2 = “dbbca”,When s3 = “aadbbcbcac”, return true. When s3 = “aadbbbaccc”, return fa原创 2015-05-28 15:10:25 · 502 阅读 · 0 评论 -
LeetCode--Minimum Window Substring(最小匹配子串)
题意:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example, S = “ADOBECODEBANC” T = “ABC” Minimum window is “BANC”.Not原创 2015-05-18 11:36:33 · 659 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
题意: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3.原创 2015-06-04 17:36:03 · 441 阅读 · 0 评论