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
What's the difference between a hashtable and a hashmap?
What is the difference between Array and Array List ? Explain in brief with example.
What is adt example?
Why is merge sort faster?
What is a treeset?
How do treesets work internally?
What is collection process?
What is the need for priority queue?
Why arraylist is not efficient for manipulation?
Does arraylist guarantee insertion order?
Does mentioning the array name gives the base address in all the contexts?
How would you use bsearch() function to search a name stored in array of pointers to string?
What is data structure and data type?
Explain the principle of quicksort. What is its complexity?
Is a hashmap a dictionary?