一.两个难点算法

1.Manacher算法,线性时间求最长回文子串

2.KMP算法,字符串匹配问题,c语言中的strStr

二.几个题目

1.最长回文子串

方法:暴力,动态规划,中心扩展,manacher

参考:

http://blog.163.com/zhaohai_1988/blog/static/2095100852012716105847112/

2.最长回文子序列

3.最长公共子序列

4.最长公共子串

[string]字符串中几个比较难的算法和容易搞混的题目的更多相关文章

  1. String 字符串中含有 Unicode 编码时,转为UTF-8

    1.单纯的Unicode 转码 String a = "\u53ef\u4ee5\u6ce8\u518c"; a = new String(a.getBytes("UTF ...

  2. 将string字符串中的换行符进行替换

    /** * 方法名称:replaceBlank * 方法描述: 将string字符串中的换行符进行替换为"" * */ public static String replaceBl ...

  3. [LeetCode] Number of Segments in a String 字符串中的分段数量

    Count the number of segments in a string, where a segment is defined to be a contiguous sequence of ...

  4. [CareerCup] 1.1 Unique Characters of a String 字符串中不同的字符

    1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot us ...

  5. [LeetCode] Add Bold Tag in String 字符串中增添加粗标签

    Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and ...

  6. [LeetCode] Permutation in String 字符串中的全排列

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  7. String:(字符串)中常用的方法

    package stringyiwen; //字符串中常用的方法public class StringTest03 { public static void main(String[] args) { ...

  8. 434 Number of Segments in a String 字符串中的单词数

    统计字符串中的单词个数,这里的单词指的是连续的非空字符.请注意,你可以假定字符串里不包括任何不可打印的字符.示例:输入: "Hello, my name is John"输出: 5 ...

  9. [LeetCode] 567. Permutation in String 字符串中的全排列

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

随机推荐

  1. Android图片编译报错

    一. AAPT err(1118615418): ERROR: 9-patch image icon_item_bottom_line.9.png malformed No marked region ...

  2. 地图:CLGeocoder地址解析与反地址解析

    1.导入系统框架

  3. nginx,php日志分割

    作者:zhanhailiang 日期:2014-01-06 默认nginx只会生成一个access.log和一个error.log,并且每天不断积累,日志文件会变的非常大,如果需要做一下日志的分析,无 ...

  4. js 函数(function)

    <Javascript高级程序设计第三版> 3.7 函数 1. ECMAScript中的函数在定义时,不必指定是否返回值. 2. 位于return语句之后的任何code都永远不会执行.(之 ...

  5. 简单的Mvp设计

    任务:从网络上获取数据,然后显示在MainActivity的ListView上 一.载入需要用的框架 1.Mvp框架 compile 'com.hannesdorfmann.mosby:mvp:2.0 ...

  6. php array 排序 感悟

    array  排序总体有这几个函数sort.rsort.asort.arsort.ksort.krsort.usort.uasort.uksort. 一开始我记来记去总是有点混乱,后来认真对比后终于清 ...

  7. springmvc+mybatis如何分层

    通常情况下,我们之间调用mapper,spring会为我们注入其实现,很方便,mybatis也提供了一个generator供我们生成bean.dao接口等.但是总有一种感觉叫不爽,感觉除了bean和m ...

  8. The package does not support the device architecture (x86). You can change the supported architectures in the Android Build section of the Project Opt

    The package does not support the device architecture (x86). You can change the supported architectur ...

  9. Nginx 变量漫谈(七)

    在 (一) 中我们提到过,Nginx 变量的值只有一种类型,那就是字符串,但是变量也有可能压根就不存在有意义的值.没有值的变量也有两种特殊的值:一种是“不合法”(invalid),另一种是“没找到”( ...

  10. Oracle EBS-SQL (PO-12):检查期间请购单的下达记录数.sql

    SELECT DECODE(PRHA.INTERFACE_SOURCE_CODE,'','手工','MRP','自动') 下达方式, PRHA.CREATION_DATE                ...