A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d3/d22/quick__sort__iterative_8cpp.html below:

TheAlgorithms/C++: sorting/quick_sort_iterative.cpp File Reference

Self-test implementations.

95{

96

97 std::vector<int> case1={100,534,1000000,553,10,61,2000,238,2756,9,12,56,30};

98 std::cout<<"TEST 1\n";

99 std::cout<<"Before: \n";

100 for(auto x : case1) std::cout<<x<<",";

101 std::cout<<"\n";

103 assert(std::is_sorted(std::begin(case1),std::end(case1)));

104 std::cout<<"Test 1 succesful!\n";

105 std::cout<<"After: \n";

106 for(auto x : case1) std::cout<<x<<",";

107 std::cout<<"\n";

108

109

110 std::vector<int> case2={-10,-2,-5,-2,-3746,-785,-123, -452, -32456};

111 std::cout<<"TEST 2\n";

112 std::cout<<"Before: \n";

113 for(auto x : case2) std::cout<<x<<",";

114 std::cout<<"\n";

116 assert(std::is_sorted(std::begin(case2),std::end(case2)));

117 std::cout<<"Test 2 succesful!\n";

118 std::cout<<"After: \n";

119 for(auto x : case2) std::cout<<x<<",";

120 std::cout<<"\n";

121}

void iterativeQuickSort(std::vector< int > &arr)

The main sorting function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4