Write programs for Bubble Sort, Quick sort
Answer Posted / srinivsa
void bubbleSort(int numbers[], int array_size)
{
int i, j, temp;
for (i = (array_size - 1); i >= 0; i--)
{
for (j = 1; j <= i; j++)
{
if (numbers[j-1] > numbers[j])
{
temp = numbers[j-1];
numbers[j-1] = numbers[j];
numbers[j] = temp;
}
}
}
}
Is This Answer Correct ? | 57 Yes | 17 No |
Post New Answer View All Answers
Can we modify final arraylist?
Can arraylist be empty?
Which is the parent class of printerstatereasons class?
How many sorting are there in data structure?
Is arraylist a collection?
What is sorted map?
How remove all from arraylist?
What is sequential sorting?
Explain the principle of quicksort. What is its complexity?
What is example of data?
How to initialize Dictionary using collection initialize?
How do I start preparing for placement?
State the properties of b tree.
Why do we need linked list?
Explain extended binary tree.