![]() Swapped = 0 / * If no element is swapped array is sorted * / / * In the following loop compare every pair of adjacent elements and check Void BubbleSort(int array,int number_of_elements) (i) Compare two adjacent elements and check if they are in correct order( that is second one has * Logic : Do the following thing until the list is sorted * Calling this functions sorts the array */ * In the following loop compare every pair of adjacent elements and checkįor (iter = 0 iter < number_of_elements iter ++) Swapped = 0 /* If no element is swapped array is sorted */ Void BubbleSort ( int *array, int number_of_elements ) (ii) Swap them if they are not in correct order. (i) Compare two adjacent elements and check if they are in correct order(that is second one has * Logic : Do the following thing until the list is sorted ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |