C++ Sorting and Searching: Exercises, Practice, Solution
C++ Sorting and Searching [14 exercises with solution]
[An editor is available at the bottom of the page to write and execute the scripts.]
1. Write a C++ program to sort the values of three variables which contain any value (numbers and/or literals). Go to the editor
Click me to see the sample solution
2. Write a C++ program to sort an array of positive integers using the Bead sort algorithm. Go to the editor
Click me to see the sample solution
3. Write a C++ program to sort a list of numbers using Bogosort algorithm. Go to the editor
Click me to see the sample solution
4. Write a C++ program to sort an array of elements using the Bubble sort algorithm. Go to the editor
Click me to see the sample solution
5. Write a C++ program to sort an array of elements using the Cocktail sort algorithm. Go to the editor
Click me to see the sample solution
6. Write a C++ program to sort an array of elements using the Counting sort algorithm. Go to the editor
Click me to see the sample solution
7. Write a C++ program to sort an array of elements using the Gnome sort algorithm. Go to the editor
Click me to see the sample solution
8. Write a C++ program to sort an array of elements using the Heapsort sort algorithm. Go to the editor
Click me to see the sample solution
9. Write a C++ program to sort an array of elements using the Insertion sort algorithm. Go to the editor
Click me to see the sample solution
10. Write a C++ program to sort a collection of integers using the Merge sort. Go to the editor
Click me to see the sample solution
11. Write a program in C++ to print the result of the specified operations. Go to the editor
Click me to see the sample solution
12. Write a C++ program to sort a collection of integers using the Quick sort. Go to the editor
Click me to see the sample solution
13. Write a C++ program to sort a collection of integers using the Radix sort. Go to the editor
Click me to see the sample solution
14. Write a C++ program to sort a collection of integers using the Selection sort. Go to the editor
Click me to see the sample solution
CPP Code Editor:
More to Come !
Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.