Cracking the Coding Interview(1)
摘要:
1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures?判断一个单词中是否存在相同字母#include <iostream>#include <string>using namespace std;int unique(const string& a){ bool boola[255]={0}; for (int i=0;i<a.length();i++) 阅读全文
posted @ 2013-02-25 14:05 mymemory 阅读(190) 评论(0) 推荐(0)