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/d6/d1a/dnf__sort_8cpp.html below:

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

Self-test implementations.

74 {

75

76

77 std::vector<uint64_t> array1 = {0, 1, 1, 2};

78 std::cout << "Test 1... ";

80 assert(std::is_sorted(std::begin(arr1), std::end(arr1)));

81 std::cout << "passed" << std::endl;

82

83

84 std::vector<uint64_t> array2 = {1, 0, 0, 1, 1, 0, 2, 1};

85 std::cout << "Test 2... ";

87 assert(std::is_sorted(std::begin(arr2), std::end(arr2)));

88 std::cout << "passed" << std::endl;

89

90

91 std::vector<uint64_t> array3 = {1, 1, 0, 0, 1, 2, 2, 0, 2, 1};

92 std::cout << "Test 3... ";

94 assert(std::is_sorted(std::begin(arr3), std::end(arr3)));

95 std::cout << "passed" << std::endl;

96

97

98 std::vector<uint64_t> array4 = {2, 2, 2, 0, 0, 1, 1};

99 std::cout << "Test 4... ";

101 assert(std::is_sorted(std::begin(arr4), std::end(arr4)));

102 std::cout << "passed" << std::endl;

103}

std::vector< T > dnfSort(const std::vector< T > &in_arr)

The main function implements DNF sort.


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