求最大最小值的O(3n/2)算法

《算法導論》上面第九章開章的算法,簡單。貌似《編程之美》上面也有。 #include <vector> #include <ctime> //time(0) #include <cstdlib> //rand() #include <iostream> using namespace std; const int MAX_VECTOR_SIZE = 10; int main() { vector<
相關文章
相關標籤/搜索