int main(void) { Median m; cout << "Please enter values " <<endl; while (!cin.eof()) { int value; cin >> value; m.insert(value); cout << "New median is " << m.getMedian() << endl; } return 0; }
int main (void) { std::vector<int> A = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; std::reverse(A.begin(), A.end()); std::cout << A << std::endl; Median<int> M; for (const auto& a: A) { debug(a); M.push(a); debug(M.getMedian()); } return 0; }