基本上,任何人都知道,新C++ 11 forward_list
类的sort()
函数的Big-O符号(需要赋值)应该是什么?使用BigO符号排序forward_lists?
只是一个小的它的工作例如:从文件中读取:
std::forward_list<string> words3;
ifstream songs;
songs.open ("songs.txt");
string line;
while (songs){
getline (songs, line);
words3.push_front(line);
}
words3.sort();
在此先感谢。
[cppreference](http://en.cppreference.com/w/cpp/container/forward_list/sort)适合查找这些类型的东西。 –