码迷,mamicode.com
首页 >  
搜索关键字:longest ordered subs    ( 3212个结果
SurfaceView-----------------转
SurfaceView是视图(View)的继承类,这个视图里内嵌了一个专门用于绘制的Surface。你可以控制这个Surface的格式和尺寸。Surfaceview控制这个Surface的绘制位置。 surface是纵深排序(Z-ordered)的,这表明它总在自己所在窗口的后面。surfacevi...
分类:其他好文   时间:2015-05-21 12:40:04    阅读次数:102
【数据结构】——排序算法——1.3、二叉树排序
【数据结构】——排序算法——1.2、二叉树排序 一、先上维基的图:二叉树排序wiki 图一、二叉树排序 二、描述 二叉查找树(英语:Binary Search Tree),也称二叉搜索树、有序二叉树(英语:ordered binary tree),排序二叉树(英语:sorted binary tree),是指一棵空树或者具有下列性质的二叉树: 若任意节点的左子...
分类:编程语言   时间:2015-05-21 10:52:21    阅读次数:190
leetcode_Longest Common Prefix
有两种思路: 1.从0向最大的公共前缀长度进行,i=0,即每次从0循环至strs.length,所有的字符都相等,则count++,直至有一个字符不相同为止,循环终止 2.假设 longest common prefix 等于字符串数组的最短字符串的长度,从0循环至strs.length,在前面最长公共最大长度的基础上比较相邻两个串的最大公共子串 个人感觉还是第一种思路更好,用到的额外存储空间更少,时间也更短...
分类:其他好文   时间:2015-05-20 11:25:46    阅读次数:130
Tree Diameter
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree.The diameter of a tree T...
分类:其他好文   时间:2015-05-20 07:07:30    阅读次数:129
LeetCode 003. Longest Substring Without Repeating
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. F...
分类:其他好文   时间:2015-05-20 02:18:57    阅读次数:100
string--字符串类型的函数方法类
TrimStart()--去掉前面的空格TrimEnd()--去掉后面的空格Trim()--去掉字符串前后的空格ToUpper()--把字符串中的小写英文字符转换成大写ToLower()--把字符串中的大写英文字符转换成小写Replace("要被替换的","要去替换的")返回替换后的字符串。Subs...
分类:其他好文   时间:2015-05-19 20:51:18    阅读次数:110
(leetcode)Longest Common Prefix
class Solution {public: string longestCommonPrefix(vector& strs) { int len = strs.size(); if(len == 0) return ""; string prefix = strs[0]; for(...
分类:其他好文   时间:2015-05-18 22:56:09    阅读次数:144
【LeetCode】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”, whic...
分类:其他好文   时间:2015-05-18 18:54:52    阅读次数:99
linux下vim和bash配置文件 源文件
1. ~/.vimrc "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限 set nocompatible set autoread " 文件修改之后自动载入 set completeopt=longest,menu " 自动完成 set history=1000 "记录历史的行数 s...
分类:系统相关   时间:2015-05-18 16:23:20    阅读次数:228
soj 4421 最长回文子序列
题意: 给你一个字符串,求该字符串的最长回文子序列长度。 解法: 以前做过连续最长回文子串的长度就是通过构造奇数偶数长度的来做,而本题是不连续。 注意到回文字符串的特点是从左边向右边看和从右边向左边看是一样的效果,那么就可以把目标字符串s导致后产生一个t,子串中如果t和s相同那么这个子串就是回文子串,那么就转化为这两个子串求LCS(longest common subsequent)的问题了。 我的...
分类:其他好文   时间:2015-05-17 13:46:04    阅读次数:123
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!