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
Define distributed query and linked server?
Is arraylist better than array?
What is static array?
What is binary tree in discrete mathematics?
Define hashing?
Differentiate between singly and doubly linked lists?
Does arraylist have a tostring?
What is bubble sort used for?
What is Jagged Arrays?
Can map contain duplicate keys?
What is the best data structure and algorithm to implement cache?
Does hashmap allow null keys?
What are the advantages of linked list over an array?
What are the disadvantages of sequential storage?
What is difference between stack and queue?