Update README.md

This commit is contained in:
邹晓航
2014-10-08 21:35:55 +08:00
parent 0ef6057041
commit e4e8ed3898

View File

@@ -81,6 +81,22 @@ TinySTL
######i = 10000000 -> (TinySTL::circular_buffer75ms \\ boost::circular_buffer22ms)
######i = 100000000 -> (TinySTL::circular_buffer604ms \\ boost::circular_buffer252ms)
######i = 1000000000 -> (TinySTL::circular_buffer5936ms \\ boost::circular_buffer2241ms)
std::string str("abcdefghijklmnpqrstuvwxyz");
TinySTL::bitmap<26> bm;
for (auto it = str.cbegin(); it != str.cend(); ++it){
bm.set(*it - 'a');
}
cout << bm << endl;
cout << bm.size() << endl;
for (int i = 0; i != 26; ++i){
if (!bm.test(i))
cout << "字母" << (char)('a' + i) << "没出现!!!" << endl;
}
题目利用bitmap找出str中未出现的字母
输出结果:
111111111111110111111111111000000
32
字母o没出现