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
Which list does not allow duplicates?
What do you mean by heap order property?
How can you insert a node at the end of linked list?
What is range search?
What is push and pop in stack?
What is sorting problem?
How to print element of Array?
What do you mean by recursive definition?
What is the difference between Array and LinkedList?
How do you declare A pointer to array of three chars
What is the procedure to insert into a sorted array?
What is hash value of a string?
Explain what is binary search?
Write an algorithm to show various operations on ordered list and arrays
What is the difference between ienumerable and list?