由买买提看人间百态

topics

全部话题 - 话题: string
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
f********r
发帖数: 50
1
来自主题: Programming版 - c++ string 一问
写了个小程序,应该能做这个工作
但是可能还有些bug
在此炮砖引玉了
#include
#include
using namespace std;
int main()
{
string a="test.txt";
string key=".txt";
string::size_type pos=a.rfind(key);
if ( pos!=string::npos)
{
a.erase(pos);
}
cout<< a< return 0;
}
i*c
发帖数: 1132
2
I found this elegant code using string.
string swtch(string topermute, int x, int y)
{
string newstring = topermute;
newstring[x] = newstring[y];
newstring[y] = topermute[x]; //avoids temp variable
return newstring;
}
void permute(string topermute, int place)
{
if(place == topermute.length() - 1)
{
cout< }
for(int nextchar = place; nextchar <
topermute.length(); nextchar++)
{
permute(swtch(topermute, place, nextchar),
b**n
发帖数: 289
3
来自主题: Programming版 - Question about
我看到各处介绍C++ string的时候,都说要用string,就要有这两句:
#include
using std::string;
但实际上,我在我的机器上只用
using std::string; 居然也可以用了。不知道为什么,哪位达人解达一下,谢谢。
g++ 4.0.2
f*******y
发帖数: 988
4
来自主题: Programming版 - a string define question (c++)
string literal比较tricky的地方就是他们的真正类型其实是const char []

这个通过了,因为你的编译器是先算 operator + (std::string, std::string),
const char [8] 被cast成std::string 了
这个不行是因为 operator + (const char [6], const char [8]) 不存在
你搞个const std::string message = hello + (", world" + "!");就不行
G*******n
发帖数: 2041
5
【 以下文字转载自 JobHunting 讨论区 】
发信人: GreenBean (I am THE Greenbean), 信区: JobHunting
标 题: char *p = "string literal"; 和 char a[] = "string liter
发信站: BBS 未名空间站 (Tue Aug 12 01:56:44 2008)
char *f(void)
{
char a[] = "string literal";
return a;
}
//bad: returning address of local variable or temporary
char *f(void)
{
char *p = "string literal";
return p;
}//Is this good?
这里这个p怎么理解,不也是local的吗?据说是static的所以没问题?可是没定义是static
的啊?
r****t
发帖数: 10904
6
来自主题: Programming版 - 问一个python的string split问题
a.split?
Type: builtin_function_or_method
Base Class:
String Form:
Namespace: Interactive
Docstring:
S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in the string S, using sep as the
delimiter string. If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator
m*****m
发帖数: 242
7
来自主题: Programming版 - typedef basic_string string;
get below by google, is it what you say?
Although we usually treat the C++ string as a class, this is really not the
case. The string type is a specialization of a more general constituent, the
basic_string< > template. Observe how string is declared in the Standard C+
+ header file:[38]
typedef basic_string string;
To understand the nature of the string class, look at the basic_string< >
template:
template,
class allocator = allocator
z****e
发帖数: 2024
8
#include
#include
ifstream inf("your_file_wants_to_be_read.txt");//source file
vector vs((istream_iterator(inf)),
istream_iterator());//read into string vector
for the second sentence, pay attention, do not be fooled by the "most vexing
parse of C++",
else you will only define a function rather than a vector.
c**********e
发帖数: 2007
9
It looks that`in Java, there is a function Split which convert a string to a
string array. I wonder if we could do the same in C++. How to do the
conversion?
string MyString = "value1;value2;value3;value4;"
string[] MyStringArray = MyString.Split(';');
MyStringArray[0] (would give value1)
MyStringArray[1] (would give value2)
etc......
g*****1
发帖数: 998
10
【 以下文字转载自 JobHunting 讨论区 】
发信人: guagua1 (), 信区: JobHunting
标 题: 请教c++的string vector问题,谢谢!
发信站: BBS 未名空间站 (Mon Feb 28 11:16:46 2011, 美东)
下面这段代码,在vc express2010里编译通不过,但是我试了g++就可以。
另外,我把string vector改成注解掉的那段里的int vector, vc就可以通过。
请问我这个应该怎么改一下呢?我希望在vc里用。
#include
#include
#include
#include
using namespace std;
int main () {

char *m1[] = {"a","e","c","m"};
vector v1(m1,m1+4);
char *m2[] ={"n"};
vector v2(m2,m2+1... 阅读全帖
h********n
发帖数: 1671
11
来自主题: Programming版 - static vector 怎么 initialize ?
向别人问问题起码要虚心一点,自己问的不清楚也不能责怪别人,别人来回答已经是很
热心了。
static变量可以用一个函数的返回值来初始化,可以任意复杂,也不限于class member
。但是复杂数据结构的static变量最好不要进行复杂的初始化。如果只是book
knowledge,最好是直接用char* array,不要用vector。如果必需要用有复杂
数据结构的static变量,最好是先缺省初始化为empty,然后在main()里动态的进行初
始化。
using namespace std;
struct A
{
static vector v;
static vector f(){ vector v; v.push_back("123"); v.push_back
("abc"); return v;}
};
vector A::v = A::f();
int main()
{
cout << A::v[0] << " " << A::v[1] << endl;
}
h********n
发帖数: 1671
12
来自主题: Programming版 - static vector 怎么 initialize ?
向别人问问题起码要虚心一点,自己问的不清楚也不能责怪别人,别人来回答已经是很
热心了。
static变量可以用一个函数的返回值来初始化,可以任意复杂,也不限于class member
。但是复杂数据结构的static变量最好不要进行复杂的初始化。如果只是book
knowledge,最好是直接用char* array,不要用vector。如果必需要用有复杂
数据结构的static变量,最好是先缺省初始化为empty,然后在main()里动态的进行初
始化。
using namespace std;
struct A
{
static vector v;
static vector f(){ vector v; v.push_back("123"); v.push_back
("abc"); return v;}
};
vector A::v = A::f();
int main()
{
cout << A::v[0] << " " << A::v[1] << endl;
}
r****t
发帖数: 10904
13
来自主题: Programming版 - static vector 怎么 initialize ?
这个地方 vector A::v = A::f();
这一句没有像你说的一样写在 main() 里面,是笔误,还是就应该在外面?

member
struct A
{
static vector v;
static vector f(){ vector v; v.push_back("123"); v.push_back
("abc"); return v;}
};
vector A::v = A::f();
int main()
{
cout << A::v[0] << " " << A::v[1] << endl;
}.
m*********a
发帖数: 3299
14
来自主题: Programming版 - Reverse Words in a String
这个字符串间可能有多个空格,要把空格去掉,留一个。最前面和最后面没有空格。这
个要用到额为的空间,比如stack,不能在原来字符串操作,如果要O(n)吧?
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
click to show clarification.
Clarification:
What constitutes a word?
A sequence of non-space characters constitutes a word.
Could the input string contain leading or trailing spaces?
Yes. However, your reversed string should not contain leading or
trailing spaces.
How about mul... 阅读全帖
s*****r
发帖数: 59
15
来自主题: Windows版 - excel VBA string process question
in excel VBA, how could a person specify return a string B from string A,
where string B=start 4th charactor in string A, and string B's length is 5?
Thanks.
Also, when do a file search under a dir. , how could returned file name keep
its uppercase/undercase? like if the file name is "HelloWorld", how could
keep it the way it is instead of "helloworld" ? Thanks.
w*******y
发帖数: 60932
16
Musicians Friend has 10 packs of EXL120 strings for $4.01 with free shipping
. This is the best deal I've ever seen for D'addario guitar strings. This is
my first post, so please delete if duplicate.
link:
Link:
http://accessories.musiciansfriend.com/product/D'Addario-EXL120-Electric-Guitar-Strings-10Pack?sku=104509
#39;Addario-EXL120-Electric-Guitar-Strings-10Pack?sku=104509" rel="nofollow"
target="_blank" onclick="_gaq.push(['_trackEvent', 'thread', 'click', '
2415284 - daddario-exl120-electri... 阅读全帖
n**n
发帖数: 1489
17
http://timesofindia.indiatimes.com/india/China-made-string-kill
Sangrur: A 15-year-old schoolboy died on the spot of a head injury he
sustained from a fall from the scooter when he got entangled in a China-made
string. The incident happened on Sunday, the day Tanvir Singh, a class IX
student of General Gurnam Singh School, turned 15.
Tanvir was going to buy a birthday cake for himself, when he got entangled
in a string near the Nankiana roundabout and lost balance. His scooter hit
an electric po... 阅读全帖
h****n
发帖数: 4960
18
来自主题: FleaMarket版 - [出售]Exxon mobil gift card, $[email protected]

(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){... 阅读全帖
h****n
发帖数: 4960
19
来自主题: FleaMarket版 - [出售]Exxon mobil gift card, $[email protected]

(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){... 阅读全帖
r*******1
发帖数: 2894
20
来自主题: FleaMarket版 - 【出售】Safeway CVS Dillards [email protected]
400刀 toysrus [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
面值100的
4000+ Sears [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=... 阅读全帖
c**********e
发帖数: 2007
21
来自主题: JobHunting版 - C++ Q66: reverse a string -- is it efficient
我写的下面的程序是不是很不efficient?
#include
#include
#include
using namespace std;
int main(){
string input = string("reverse_this_string");
int n=input.size();
const char* c_str=new char[n+1];
c_str=input.c_str();
char* c_str2=new char[n+1];
for(int i=0;i cout << string(c_str2) << endl;
return 0;
}
m*****n
发帖数: 2152
22
来自主题: JobHunting版 - C++ Q66: reverse a string -- is it efficient
#include
#include
using namespace std;
int main(){
string input("reverse_this_string");
string::iterator it_first = input.begin();
string::iterator it_last = input.end()-1;
while(it_first < it_last)
swap(*it_first++, *it_last--);
return 0;
}
g*****1
发帖数: 998
23
来自主题: JobHunting版 - 请教c++的string vector问题,谢谢!
下面这段代码,在vc express2010里编译通不过,但是我试了g++就可以。
另外,我把string vector改成注解掉的那段里的int vector, vc就可以通过。
请问我这个应该怎么改一下呢?我希望在vc里用。
#include
#include
#include
#include
using namespace std;
int main () {

char *m1[] = {"a","e","c","m"};
vector v1(m1,m1+4);
char *m2[] ={"n"};
vector v2(m2,m2+1);

vector u;
/* int m1[] = {1,2,3,4};
vector v1(m1,m1+4);
int m2[] ={100};
vector v2(m2,m2+1);

vector... 阅读全帖
j*******r
发帖数: 52
24
试贴一个C++代码,循环+递归,用一个bitset代表当前字符是否已经在之前位置被使用。
1 #include
2 #include
3 #include
4
5 using namespace std;
6
7 void permutation(const char* str, bitset<4> used, string r){
8 if(r.size() == strlen(str)){
9 cout< 10 }
11 for(int i = 0; i < strlen(str); ++i){
12 if(used[i])
13 continue;
14 used.set(i);
15 r += str[i];
16 permutation(str, used, r);
17... 阅读全帖
j*******r
发帖数: 52
25
试贴一个C++代码,循环+递归,用一个bitset代表当前字符是否已经在之前位置被使用。
1 #include
2 #include
3 #include
4
5 using namespace std;
6
7 void permutation(const char* str, bitset<4> used, string r){
8 if(r.size() == strlen(str)){
9 cout< 10 }
11 for(int i = 0; i < strlen(str); ++i){
12 if(used[i])
13 continue;
14 used.set(i);
15 r += str[i];
16 permutation(str, used, r);
17... 阅读全帖
s******d
发帖数: 61
26
我的返回结果是这个,不知道哪里错了
d:1e:1h:1l:1o:1r:1w:1
import java.util.Collection;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
public class Findfrequency {
public String find(String s){
char[] ch=s.toCharArray();
Hashtable hash=new Hashtable();
for(int i=0;i Character temp=new Character(ch[i]);
if(!hash.contains(temp)){
hash.put(temp, new Integer(1));
}
else{
Integer in=hash.get(temp);
in++;... 阅读全帖
f*******t
发帖数: 7549
27
来自主题: JobHunting版 - Exposed上一道string permutation的题
我改进了一下,这回貌似行了,不过输出没能按照字典序:
#include
#include
#include
using namespace std;
void swap(string& s, int idx1, int idx2) {
if(idx1 == idx2)
return;
char temp = s[idx1];
s[idx1] = s[idx2];
s[idx2] = temp;
}
void permutation(string& s, int index, int size) {
if (index == size)
cout << s << endl;
else {
char last = 0;
for (int i=index; i if(s[i] == last)
continue;
... 阅读全帖
j********e
发帖数: 1192
28
来自主题: JobHunting版 - google scramble string O(n) 解法
我没有说字符集相同就能scramble,字符集相同是必要条件,而不充分。
我的做法是,先找到一个位置i在s1,j在s2使得分割后的4个字符串两两
有相同的字符集(i=j 或者i=N-j)。然后接着对这2对字符串继续做同样
的事情连寻找分割位置。这样递归下去,如果有某对字符串无法找到分割
位置,则表示失败。否则,最后分隔最小的字符串只有一个字符。就可以
判断scramble成功。
问题是,如果有多个分割位置,是否任选一个都可以?如果必须测试每个可能的分割位置,那复杂度就不好说了。
下面是我的简单实现代码,通过了leetcode的online judge (包括judge large)。这段代码中会处理所有可能的分割位置。如果只选第一个可能的分割位置,有一个测试失败了。
#include
#include
#include
#include
using namespace std;
#define BITMAP_LEN 256
bool compare_char_set(const char *s1, con... 阅读全帖
Z*****Z
发帖数: 723
29
来自主题: JobHunting版 - 问道string match的题
public static void main(String[] args) {
System.out.println(getCommon("1234", "3451"));
System.out.println(getCommon("12", "123"));
System.out.println(getCommon("123", "12"));
System.out.println(getCommon("12", "12"));
}
static String getCommon(String s1, String s2) {
char[] arr1 = s1.toCharArray();
char[] arr2 = s2.toCharArray();
int[] failure = buildFailureTable(arr2);
int i = -1, j = -1;

if(arr2.length < arr1.leng... 阅读全帖
W***u
发帖数: 81
30
来自主题: JobHunting版 - 问一个 String array sorting 的题。
原题是,Write a method to sort an array of strings so that all the anagrams
are next to each other.
看到的靠谱的方法是 先 sort 每一个string,然后给每一个sorted后的string
generate 一个key 然后用hashtable 来找到 anagrams的String. 我的问题是这个hash
table 如何生成,能够保证,解决conflicts,并且保证O(1)的查找呢?
本人菜鸟,对hashtable的理解还在寻找hash function 然后每一个key 对应一个
value的层次。简单的就是在知道key的范围的时候用数组实现,当不知道key值范围的
时候就不知道怎么搞了? 看到C++里的hashtable 实现都是 按照pair
入进去的,真心不知道这样的查找怎么能够保证O(1).
求各位前辈高人解疑释惑。 拜谢!
N*********6
发帖数: 4372
31
来自主题: JobHunting版 - 关于String Interleaving 验证的问题
看到板上有网友报面经,往前翻翻发现大家讨论过很多次
小弟有几个问题
String a 长度 m
String b 长度 n
String c 长度 m+n
verify c 是不是a 和 b的interleaving
1. 这道题用DP的话时间上应该是O(m*n),空间上填2d table的话是O(m*n)
如果重复利用行的话可以到O(n)
2. 如果是Recursion的话复杂度是多少呢?我不理解的是如果c
当前字符和a的当前字符以及b的当前字符都一样的话,要分两路
去查找,当然第一路如果返回true的话第二路就没必要了,可是
一个比较极端的例子
a: aaaaa
b: aaaad
c: aaaadaaaaa
如果算法在遇到相同的字符是先假定是从a string来的,这个例子
就会非常time consuming,需要不停back tracking,请问这种情况
下recursion的复杂度是多少呢?
昨天在leetcode上用recursion发现small data可以过,large的
就超时了
3. 如果递归,我个人觉得不应该在开始比较字符串长度是否相等吧?
因为每次获取... 阅读全帖
H****s
发帖数: 247
32
来自主题: JobHunting版 - string scramble 的时间复杂度
居然没人回答,估计是我的问题太弱了,自己顶,把题目也贴在这里
Given a string s1, we may represent it as a binary tree by partitioning it
to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
great
/ \
gr eat
/ \ / \
g r e at
/ \
a t
To scramble the string, we may choose any non-leaf node and swap its two
children.
For example, if we choose the node "gr" and swap its two children, it
produces a scrambled string "rgeat".
rgeat
/ \
... 阅读全帖
n******r
发帖数: 869
33
实在太落后了。看了解法还是不会写。
Design an algorithm to print all permutations of a string. For simplicity,
assume all characters are unique.
Test String: abcdefg
Case “a” --> {a}
Case “ab” --> {ab, ba}
Case “abc” --> ?
This is the first “interesting” case. If we had the answer to P(“ab”),
how could we generate P(“abc”). Well, the additional letter is “c”, so
we can just stick c in at every possible point. That is:
merge(c, ab) --> cab, acb, abc
merge(c, ba) --> cba, bca, bac
Algorithm: Use a recursive algorit... 阅读全帖
c***l
发帖数: 8
34
来自主题: JobHunting版 - scramble string
Just found that OJ test example for "scramble string" has some problem.
For example, "abcd", "acbd" returns true. But it seems impossible that "acbd
" is a scrambled string of "abcd" according to the definition for scrambled
string; see http://discuss.leetcode.com/questions/262/scramble-string
Did anyone work on the problem before?
h******6
发帖数: 2697
35
来自主题: JobHunting版 - Reverse Words in a String
上个不用api的
public String reverseWords(String s) {
if (s == null || s.length() == 0) {
return s;
}
int len = s.length();
Stack stack = new Stack();
int start = 0;
int i = 0;
while (i < len) {
if (s.charAt(i) == ' ') {
if (start != i) {
stack.push(s.substring(start, i));
}
while (i < len && s.charAt(i) == ' ') {
i+... 阅读全帖
c********6
发帖数: 33
36
来自主题: JobHunting版 - Reverse Words in a String
static String reverseWords(String s)
{
if(s.length() == 0) return s;
s += " ";
StringBuilder temp = new StringBuilder();
Stack stack = new Stack();
for(int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if(c == ' ')
{
if(temp.length() > 0) stack.push(temp.toString());
temp = new StringBuilder();
}
else temp.append(c);
}
... 阅读全帖
h******6
发帖数: 2697
37
来自主题: JobHunting版 - Reverse Words in a String
上个不用api的
public String reverseWords(String s) {
if (s == null || s.length() == 0) {
return s;
}
int len = s.length();
Stack stack = new Stack();
int start = 0;
int i = 0;
while (i < len) {
if (s.charAt(i) == ' ') {
if (start != i) {
stack.push(s.substring(start, i));
}
while (i < len && s.charAt(i) == ' ') {
i+... 阅读全帖
c********6
发帖数: 33
38
来自主题: JobHunting版 - Reverse Words in a String
static String reverseWords(String s)
{
if(s.length() == 0) return s;
s += " ";
StringBuilder temp = new StringBuilder();
Stack stack = new Stack();
for(int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if(c == ' ')
{
if(temp.length() > 0) stack.push(temp.toString());
temp = new StringBuilder();
}
else temp.append(c);
}
... 阅读全帖
w****r
发帖数: 15252
39
来自主题: JobHunting版 - Java String concatenation
string 在Java里面是 immutable data type, 意思就是一旦建立就不能改了, 所以s1
就会在string pool里面再建一个string,两个reference不一样,而是s2建立的过程
Java回去string pool里面找是否有ABC,如果存在就引用,不存在再新建,所以s和s2是
一个reference
l******9
发帖数: 579
40
I am designing a SQL Server 2008 R2 query.
If I used string concatenation to insert into table, it does not work.
DECLARE @s1 varchar(MAX);
DECLARE @s2 varchar(MAX);
DECLARE @s3 varchar(MAX);
DECLARE @s4 varchar(MAX);
SET @s1 = 'SELECT a.id, b.name as new_name, a.value FROM ['
SET @s2 = '].[dbo].[table1] as a, '
SET @s3 = 'a_temp_table as b ' -- a_temp_table is a table variable. No
matter I put "@" or "#" in front of a_temp_table, it doe snot work.
SET @s4 = 'WHERE a.id = b.i... 阅读全帖
p****6
发帖数: 724
41
public static boolean oneEditApart(String a, String b) {

String small = a.length() > b.length() ? b : a;
String large = a.length() > b.length() ? a : b;

int operation = 0;
//case 1, two word's length differ by more than one
if(large.length() - small.length() > 1) return false;
//case 2, length is equal, check every char one by one
else if(large.length() == small.length()){
int i = 0;
while(i < sma... 阅读全帖
p*****2
发帖数: 21240
42
来自主题: JobHunting版 - Isomorphic Strings 的单Hashmap解法
def isomorphicString(s1:String, s2:String) = {
val f = (s1:String, s2:String) => s1.zip(s2).groupBy(_._1).map(_._2.
toSet).forall(_.size==1)
f(s1,s2) && f(s2,s1)
}
g********r
发帖数: 89
43
来自主题: JobHunting版 - reverse words in a string
大牛来指点一下代码有没有改进的地方?
方法的就是从string tail开始一个一个的读
string reverseWord(string s)
{
string result;
int i=s.size()-1; //start from the last character
while(i>=0){
while(i>=0 && isspace(s[i])) i--; //advance i to a non-space letter
int j=i-1;
while(j>=0 && !isspace(s[j])) j--; //find the previous space
result += s.substr(j+1, i-j);
if(j>=0) result += " ";
i = j-1;
}
return result;
}
a***e
发帖数: 413
44
终于有个不让我那么抓狂的题了,我的code如下,从后往前扫,两个指针,只扫一遍,
但不算inplace.
看到的其他inplace的好像要scan两遍,有只扫一遍的inplace的做法吗?
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
class Solution {
public:
void reverseWords(string &s) {
int len=s.size();
if (len==0) return;

int start=len-1,end=len-1;
while(s[end]==' '&&s[start]==' ')
{
end--;
start--;
}
strin... 阅读全帖
l*****n
发帖数: 246
45
来自主题: JobHunting版 - 问道题string pattern match的题目
两个String,第二个是pattern。问:找到第一个string里面的最短的substring包含第
二个string里面的所有char,而且顺序跟第二个string里面的char的顺序一样。
算法复杂度要小于O(n2)
t***q
发帖数: 418
46
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 问一个如何建立一个rest web service ,其中有query string 功能。
发信站: BBS 未名空间站 (Wed Mar 4 21:28:13 2015, 美东)
如题,要建一个 web service, 有 query string 的功能。主要是,有一个 影视作品
的title 进来,用 web service 里的 一些function, 和已有的一个 flat file, 那个
flat file里,有许多影视作品的 title , 及其他一些信息, 用这个 flat file, 和
已输入的 title, 算出与之最相似的影视作品的title, 然后 call 相关 url 后, 能
有一个 hash table 输出, 其中有最相近的 title , 和 相似率, 一个类似
confidence level 的东西。
例子如下:
http://www.dreamsyssoft.com/python-scriptin... 阅读全帖
l****l
发帖数: 833
47
☆─────────────────────────────────────☆
rumorhasit (Love life) 于 (Sat Oct 13 23:35:08 2007) 提到:
Love to buy one string machine. Really appreciate if anybody can make some
recommendation? Thanks!
☆─────────────────────────────────────☆
chengtam (ZYMF) 于 (Sun Oct 14 01:02:38 2007) 提到:
It will depend on how much you want to spent and how often you're going to
string.
If you just want to string your own racket, a cheap one like Eagnas will
work.
But if you want to string more racket and is
C*I
发帖数: 58
48
I used to go to local store to string my racket. But the stringer there is not
good. Too much tension lost for me. I played tennis very often these days. So,
I am thinking about stringing by myself. BTW, I am badminton player too. Used
to play some tournament in college and grad school. So, I know how to string
racket, though tennis racket is little different. I like some stringing
machines
but they are little bit expensive (little bit beyond my budget). Good ones are
around 400--500$. I do not
p******f
发帖数: 341
49
来自主题: Tennis版 - Re: Hybird String Question
Here is somthing I found, but didn't answer all my question yet.
The mains in your string job account for the vast majority of the feel of
the string job.
The crosses don't play as big a role. So, if you are looking for a more
Lux-like string job, put Luxilon in the mains. Benefits there are increased
control.
Benefits from gut in the crosses are a softened string job and maybe a little
additional pop on the ball.
If you put gut in the mains, you will get the benefits from gut plus a little
firm
p****4
发帖数: 517
50
来自主题: Tennis版 - Polyester string and stringing
New to this forum, found the articles interesting and informative.
I string my own racquets with 17 gauge ployester on main and multifilament
on cross. Polyester has very high modulus so tiny elongation translates into
large tension increase. I usually pull main at 49/50 lbs. After the cross
is installed, main tension raises to 59/60 lbs.
Anyone here string their own racquets? Welcome to share your experience on
stringing and customizing your racquets.
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)