Swap numbers at position first with address at position second
| 85 | |
| 86 | // Swap numbers at position first with address at position second |
| 87 | void swap(std::vector<unsigned>& numbers, size_t first, size_t second) |
| 88 | { |
| 89 | auto temp{ numbers[first] }; |
| 90 | numbers[first] = numbers[second]; |
| 91 | numbers[second] = temp; |
| 92 | } |
| 93 | |
| 94 | // Recursive helper function to sort numbers in ascending sequence |
| 95 | // Numbers to be sorted are from words[start] to words[end] |