微软面试题day 6(打印所有对称子串)
2011-08-26 20:17
471 查看
题:1、如何判断一个字符串是对称的?如a,aa,aba。
2、如何利用2函数找出一个字符串中的所有对称子串?
分析:
且看第一个问题判断字符串对称,有以下两种方法。
方法一、使迭代器p1指向头,p2指向尾。使p1,p2相对而行(—> | <[b]—)[/b],每次比较p1,p2是否相等,直到它们相遇。
方法二、使p1、p2指向中间的一个元素(如果字符串长度为偶数的话就指向中间两个相邻的元素),使它们相向而行(<[b]— |[b]—>[/b])[/b],每次比较p1,p2是否相等。直到它们一个指向头一个指向尾便结束。
(可以看出方法1明显好于方法2)
现在看第二个问题打印所有的对称子串,判断对称子串的问题我们似乎已经解决,且有以上两种方法,针对现在的情况是否两种都合适呢,确切的说不是。如果是方法一,请想象一下,如果要p1,p2一个指向子串的头一个指向子串的尾,那么至少要两层循环一层控制p1一层控制p2,还有一层循环用于判断子串是否对称,也就是说总共需要三层嵌套循环,时间复杂度指数为3。而如果选择方法二呢?
两层循环就能实现,不过要适应现在这种情况需要做些修改,就是针对偶数长度的子串进行一次遍历,再针对奇数长度的子串进行一次遍历,也就是两层嵌套循环中内层有两次循环,时间复杂度指数为2。详情且看代码。
实现加测试代码:
view plain
/**
Author:花心龟
Blog:http://blog.csdn.net/zhanxinhang
**/
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class App
{
typedef string::iterator Iter_t;
string m_str;
void print(Iter_t p1, Iter_t p2) //打印从p1开始到p2结束的字符
{
while(p1<=p2)
{
cout<<*p1;
p1++;
}
cout<<" | ";
}
bool isHuiwen1(Iter_t start,Iter_t end) //法1判断是否为对称子串
{
Iter_t p1 = start;
Iter_t p2 = end;
int times = (distance(p1,p2)+1) / 2; //比较次数
while(times)
{
if(*p1 != *p2)
return false;
p1++;
p2--;
times--;
}
return true;
}
bool isHuiwen2(Iter_t mid_it) //法2判断是否为对称子串
{
Iter_t p1,p2;
p1 = p2 = mid_it;
while(p1>=m_str.begin() && p2 < m_str.end())
{
if(*p1 != *p2)
break;
print(p1,p2);//打印从p1到p2的字符
p1--,p2++;
}
p1 = p2 = mid_it;
p2++; //使p2向前移动一个位置,此时p1,p2分别指向中间两个相邻位置
while(p1>=m_str.begin() && p2 < m_str.end())
{
if(*p1 != *p2)
return false;
print(p1,p2);//打印从p1到p2的字符
p1--,p2++;
}
return true;
}
void show_all_substr_of_huiwen1() //法一打印所有对称子串
{
Iter_t p2=m_str.end()-1;
Iter_t p1 = m_str.begin();
for(;p1!=m_str.end();p1++)
for(p2=p1;p2!=m_str.end();p2++)
{
if(isHuiwen1(p1,p2))
print(p1,p2);
}
}
void show_all_substr_of_huiwen2() //法二打印所有对称子串
{
Iter_t it = m_str.begin();
for(;it!=m_str.end();it++)
{
isHuiwen2(it);
}
}
public:
void run()
{
m_str="abaaba";
cout<<"测试数据为:abaaba"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
m_str="asdfie";
cout<<"测试数据为:asdfie"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
m_str="aabaa";
cout<<"测试数据为:aabaa"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
//时间比较//
m_str="this is a string for testing. aabaa alskjdfkljasdjflasdflkajsldkjfsjlakjsdlfjwoekjlakjlsdkjflsajlkdjfowieuoriuq aaddbb sldjfalkjsdlfkjasldjflajsldfjalskdjflakjsdlfkjaslkdjflajsdlfkjaslkdjflkajsdlkjflkasjdlfjaklsjdkfljaklsdjfklsajdflkjslkdjflaskjdlfkjalsdjlfkajsldfkjlaksjdfljasldjflaskjdfkasjdflaksjdkfljaskldfjlaksjdfljasldjflaksjdkljfkalsjdlkfjasldjflasjdlfjasldjfklsajdfljaskldfjlsakjdflkasjdfkl this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k end";
time_t start,record1;
cout<<"show all substr of huiwen 1:";
system("pause");
start = time(NULL);
show_all_substr_of_huiwen1();
record1 = time(NULL);
cout<<endl;
cout<<"time:"<<record1-start;
cout<<endl;
cout<<"show all substr of huiwen 2:";
system("pause");
start = time(NULL);
show_all_substr_of_huiwen2();
record1 = time(NULL);
cout<<endl;
cout<<"time:"<<record1-start;
cout<<endl;
cout<<"(可以看到打印速度明显快于上一次)";
}
};
int main()
{
App myapp;
myapp.run();
system("pause");
return 0;
}
测试结果:
![](http://hi.csdn.net/attachment/201108/13/0_1313217860WQQL.gif)
各测试数据下的一二行为打印出来的所有对称字串。
按下任意键后:
![](http://hi.csdn.net/attachment/201108/13/0_13132171535CLn.gif)
以上是使用方法1打印出来的结果。
按下任意键后:
![](http://hi.csdn.net/attachment/201108/13/0_1313217158Ok7d.gif)
以上便是用方法2打印出来的结果。
2、如何利用2函数找出一个字符串中的所有对称子串?
分析:
且看第一个问题判断字符串对称,有以下两种方法。
方法一、使迭代器p1指向头,p2指向尾。使p1,p2相对而行(—> | <[b]—)[/b],每次比较p1,p2是否相等,直到它们相遇。
方法二、使p1、p2指向中间的一个元素(如果字符串长度为偶数的话就指向中间两个相邻的元素),使它们相向而行(<[b]— |[b]—>[/b])[/b],每次比较p1,p2是否相等。直到它们一个指向头一个指向尾便结束。
(可以看出方法1明显好于方法2)
现在看第二个问题打印所有的对称子串,判断对称子串的问题我们似乎已经解决,且有以上两种方法,针对现在的情况是否两种都合适呢,确切的说不是。如果是方法一,请想象一下,如果要p1,p2一个指向子串的头一个指向子串的尾,那么至少要两层循环一层控制p1一层控制p2,还有一层循环用于判断子串是否对称,也就是说总共需要三层嵌套循环,时间复杂度指数为3。而如果选择方法二呢?
两层循环就能实现,不过要适应现在这种情况需要做些修改,就是针对偶数长度的子串进行一次遍历,再针对奇数长度的子串进行一次遍历,也就是两层嵌套循环中内层有两次循环,时间复杂度指数为2。详情且看代码。
实现加测试代码:
view plain
/**
Author:花心龟
Blog:http://blog.csdn.net/zhanxinhang
**/
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class App
{
typedef string::iterator Iter_t;
string m_str;
void print(Iter_t p1, Iter_t p2) //打印从p1开始到p2结束的字符
{
while(p1<=p2)
{
cout<<*p1;
p1++;
}
cout<<" | ";
}
bool isHuiwen1(Iter_t start,Iter_t end) //法1判断是否为对称子串
{
Iter_t p1 = start;
Iter_t p2 = end;
int times = (distance(p1,p2)+1) / 2; //比较次数
while(times)
{
if(*p1 != *p2)
return false;
p1++;
p2--;
times--;
}
return true;
}
bool isHuiwen2(Iter_t mid_it) //法2判断是否为对称子串
{
Iter_t p1,p2;
p1 = p2 = mid_it;
while(p1>=m_str.begin() && p2 < m_str.end())
{
if(*p1 != *p2)
break;
print(p1,p2);//打印从p1到p2的字符
p1--,p2++;
}
p1 = p2 = mid_it;
p2++; //使p2向前移动一个位置,此时p1,p2分别指向中间两个相邻位置
while(p1>=m_str.begin() && p2 < m_str.end())
{
if(*p1 != *p2)
return false;
print(p1,p2);//打印从p1到p2的字符
p1--,p2++;
}
return true;
}
void show_all_substr_of_huiwen1() //法一打印所有对称子串
{
Iter_t p2=m_str.end()-1;
Iter_t p1 = m_str.begin();
for(;p1!=m_str.end();p1++)
for(p2=p1;p2!=m_str.end();p2++)
{
if(isHuiwen1(p1,p2))
print(p1,p2);
}
}
void show_all_substr_of_huiwen2() //法二打印所有对称子串
{
Iter_t it = m_str.begin();
for(;it!=m_str.end();it++)
{
isHuiwen2(it);
}
}
public:
void run()
{
m_str="abaaba";
cout<<"测试数据为:abaaba"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
m_str="asdfie";
cout<<"测试数据为:asdfie"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
m_str="aabaa";
cout<<"测试数据为:aabaa"<<endl;
show_all_substr_of_huiwen1();
cout<<endl;
show_all_substr_of_huiwen2();
cout<<endl;
//时间比较//
m_str="this is a string for testing. aabaa alskjdfkljasdjflasdflkajsldkjfsjlakjsdlfjwoekjlakjlsdkjflsajlkdjfowieuoriuq aaddbb sldjfalkjsdlfkjasldjflajsldfjalskdjflakjsdlfkjaslkdjflajsdlfkjaslkdjflkajsdlkjflkasjdlfjaklsjdkfljaklsdjfklsajdflkjslkdjflaskjdlfkjalsdjlfkajsldfkjlaksjdfljasldjflaskjdfkasjdflaksjdkfljaskldfjlaksjdfljasldjflaksjdkljfkalsjdlkfjasldjflasjdlfjasldjfklsajdfljaskldfjlsakjdflkasjdfkl this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k is is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.this is a string for testing.make -k make -k make -k make -k make -k make -k end";
time_t start,record1;
cout<<"show all substr of huiwen 1:";
system("pause");
start = time(NULL);
show_all_substr_of_huiwen1();
record1 = time(NULL);
cout<<endl;
cout<<"time:"<<record1-start;
cout<<endl;
cout<<"show all substr of huiwen 2:";
system("pause");
start = time(NULL);
show_all_substr_of_huiwen2();
record1 = time(NULL);
cout<<endl;
cout<<"time:"<<record1-start;
cout<<endl;
cout<<"(可以看到打印速度明显快于上一次)";
}
};
int main()
{
App myapp;
myapp.run();
system("pause");
return 0;
}
测试结果:
![](http://hi.csdn.net/attachment/201108/13/0_1313217860WQQL.gif)
各测试数据下的一二行为打印出来的所有对称字串。
按下任意键后:
![](http://hi.csdn.net/attachment/201108/13/0_13132171535CLn.gif)
以上是使用方法1打印出来的结果。
按下任意键后:
![](http://hi.csdn.net/attachment/201108/13/0_1313217158Ok7d.gif)
以上便是用方法2打印出来的结果。
相关文章推荐
- 每日微软面试题——day 6(打印所有对称子串)
- 每日微软面试题——day 6(打印所有对称子串)
- 打印所有不超过n(n<256)的,其平方具有对称性质的数。
- 每日微软面试题——day 7(找数组中唯一出现两次的数)
- 微软面试题day 7(找数组中唯一出现两次的数)
- 二分法解决打印所有和为s的连续整数序列 剑指offer 之 面试题41_2
- 【2013微软面试题】输出节点数为n的二叉树的所有形态
- 所谓微软面试题的解答:求一个字符串中连续出现次数最多的子串
- 算法题11 字符串的所有对称子串
- 每日微软面试题——day 1
- 输出1到N之间所有相加等于M的数字组合(背包问题)求相加为M的所有组合--微软酷派经典面试题
- [各种面试题] 打印和为给定数的所有形式
- 微软面试题系列(四):在二元树中找出和为某一值的所有路径
- 每日微软面试题——day 1
- 每日微软面试题——day 1
- 所谓微软面试题的解答:求一个字符串中连续出现次数最多的子串
- 每日微软面试题——day 5
- 面试题之微软 字符串的所有排列
- 面试题:输入一个整数和一棵二元树。从树的根结点开始往下访问一直到叶结点所经过的所有结点形成一条路径。打印出和与输入整数相等的所有路径。
- 最新的微软面试题,题目:求一个字符串中连续出现次数最多的子串