服务器端using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Wi...
分类:
其他好文 时间:
2014-08-13 21:38:07
阅读次数:
256
一、简单的0,1背包问题
1、题目描述:有n个重量和价值分别为Wi,Vi的物品。从这些物品中挑选出总重量不超过W的物品,求所选方案中价值总和的最大值(注:在0,1背包问题中,每个物品只有一件,可以选择房或者不放)。
【分析】:对于这样的问题,首先我们可以用最简单容易想到的方法,将所有可能一一例举出来,找到最合适的。
对于函数rec(int i,int j)// 这里的 i 表...
分类:
其他好文 时间:
2014-08-13 19:06:47
阅读次数:
151
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ...
分类:
其他好文 时间:
2014-08-13 12:45:46
阅读次数:
166
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,...
分类:
其他好文 时间:
2014-08-13 12:23:16
阅读次数:
237
函数库mysql存储过程基本函数包括:字符串类型,数值类型,日期类型一、字符串类CHARSET(str) //返回字串字符集CONCAT (string2 [,… ]) //连接字串INSTR (string ,substring ) //返回substring首次在string中出现的位置,不存在...
分类:
数据库 时间:
2014-08-13 00:29:34
阅读次数:
361
Main reference:http://zhaohongze.com/wordpress/2014/01/04/leetcode-minimum-window-substring/The ART of counting. So difficult and beautiful problem. I...
js中substring和substr的用法substring 方法用于提取字符串中介于两个指定下标之间的字符substring(start,end)开始和结束的位置,从零开始的索引参数 描述 start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。.....
分类:
Web程序 时间:
2014-08-12 13:05:54
阅读次数:
180
class Solution {public: int longestValidParentheses(string s) { vector stack; int maxlen = 0; int curlen = 0; int last ...
分类:
其他好文 时间:
2014-08-12 12:54:04
阅读次数:
169
You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenati...
分类:
其他好文 时间:
2014-08-12 12:40:24
阅读次数:
165
问题:有一个字符串是由ijige句子组成,其中的一个句子拥有一个项目列表,该列表以一个冒号开始(:),以一个句点结束(.),我们如何去提取这个列表
解决思路:使用indexof+String方法来找到冒号,然后再次使用它找到冒号后面的第一个据点,有了这两个位置,使用String subString方法提取字符串
提取子字符串
var sentence="this i...
分类:
编程语言 时间:
2014-08-12 10:28:33
阅读次数:
226