基本上,任何人都知道,新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)適合查找這些類型的東西。 –