C program for sorting methods using functions
02:22
/*Implement sorting methods using functions - bubble sort, selection sort
insertion sort and shell sort.
*/
output :>
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 1
Enter no of elements :3
Enter array elements :14
56
18
Unsorted Data: 14 56 18
After pass 1 14 56 18
After pass 2 14 18 56
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 2
Enter no of elements :3
Enter array elements :44
56
24
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 3
Enter no of elements :3
Enter array elements :45
65
32
Unsorted Data: 45 65 32
After pass 1 45 32 65
After pass 2 32 45 65
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 4
Enter no of elements :3
Enter array elements :22
45
16
Unsorted Data: 22 45 16
After pass 1 16 22 45
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 5
insertion sort and shell sort.
*/
output :>
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 1
Enter no of elements :3
Enter array elements :14
56
18
Unsorted Data: 14 56 18
After pass 1 14 56 18
After pass 2 14 18 56
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 2
Enter no of elements :3
Enter array elements :44
56
24
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 3
Enter no of elements :3
Enter array elements :45
65
32
Unsorted Data: 45 65 32
After pass 1 45 32 65
After pass 2 32 45 65
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 4
Enter no of elements :3
Enter array elements :22
45
16
Unsorted Data: 22 45 16
After pass 1 16 22 45
1)insertion
2)Selection
3)Bubble
4)Shell
5)Quit
Enter your choice : 5
0 comments: