Computer Science, asked by Anonymous, 1 year ago

what is bubble shorting and selection shorting in an array in java .....explain both with a suitable program....

Answers

Answered by butterflyqueen
2
Bubble sort is there in the pic hope it helps
Attachments:

Anonymous: the same book i also have
butterflyqueen: its ok
Anonymous: : )
butterflyqueen: do you know Fibonacci program
butterflyqueen: if you know please answer the question that I have posted
Anonymous: yes
Anonymous: khow
butterflyqueen: please answer my question
Answered by Anonymous
5
Here is your answer

----------------------------------------------------------------------------------------------------------------

⭕ WHAT IS BUBBLE SHOOTING ?

=> The algorithm which which steps the list to sort , this compare the the pair of adjacent items.

1. some algorithms require only a few pointers.

2. Quicksort operates in-place on the data to be sorted.

3. Bubble sort is in the java and C++

----------------------------------------------------------------------------------------------------------------

EXAMPLE : -

printf("%d ", arr[i]);

    printf("n");

}

// Driver program to test above functions

int main()

{

    int arr[] = {64, 34, 25, 12, 22, 11, 90};

    int n = sizeof(arr)/sizeof(arr[0]);

    bubbleSort(arr, n);

    printf("Sorted array: \n");

    printArray(arr, n);

    return 0;

}

( This program was wrote by my brother of 9 th standard )

----------------------------------------------------------------------------------------------------------------

⭕ What is selection shorting in an array in java.

=> The selection sort algorithm in an array by repeatedly finding the minimum element .

1. We can create a java program to sort array elements using selection sort. 

2. We can search the lowest element and we can arrange then in proper order by selection shorting.

Anonymous: perfect answer it help me alot brother
Anonymous: thanks
Similar questions