一.两个难点算法

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. aspnet_regiis 加密/解密 web.config

    加密: @echo off echo web.config c: cd c:\windows\Microsoft.NET\Framework64\v4.0.30319 aspnet_regiis -p ...

  2. XML及PullParser解析

    一.什么是XML 1.概念:extensive markup language(可扩展的标记语言) XML是一种通用的数据存储和交换格式,与平台无关,与编程语言无关,与操作系统无关.给数据集成和交互提 ...

  3. python给多个发送邮件附件,参考于《python自动化运维》

    #!/usr/bin/env python #coding: utf-8 #author:luodi date:2015/02/12 #description:this is a send mail ...

  4. 全屏显示网页FULLSCREEN API

    第一次看到应用 Fullscreen API 全屏显示网页,是 FaceBook 中的照片放大.作为一个比较新的 API,目前只有 Safari.Chrome 和 FireFox 三种浏览器支持该特性 ...

  5. inline 间距

    今天看了内联元素的间距: http://blog.csdn.net/hedong37518585/article/details/6657853

  6. Android Adapter代码片

    /** * Adapter for grid of coupons. */ private static class CouponAdapter extends BaseAdapter { priva ...

  7. webservice跨服务器上传附件

    最近一个项目,用到文件上传功能,本来简单地使用upload控件直接post到服务器保存,简单实现了.后来考虑到分布是部署,静态附件.图片等内容要单独服务器(命名为B服务器,一台,192.168.103 ...

  8. Android的Drawable

    1.获取Drawable的内部宽\高:getIntrinsicHeight/Width.但是并不是所有Drawable都有内部宽高(比如说一个颜色形成的宽高,Drawable的宽高不等于大小,大小是根 ...

  9. 碰到这个SB错误,'Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.点办

    After launching MacVim you may get this annoying error message:'Taglist: Exuberant ctags (http://cta ...

  10. 使用 phpMailer 基于(SMTP) 发送邮件

    PHPMailer是一个用于发送电子邮件的PHP函数包.它提供的功能包括:在发送邮时指定多个收件人,抄送地址,暗送地址和回复地址.支持多种邮件编码包括:8bit,base64,binary和quote ...