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 are the major data structures used in the hierarchical data model?
What is array and its types in data structure?
How expression trees are gets represented in data structure?
Given M x N matrix with sorted elements row wise and column wise, find elements?
Can hashset contain null?
What is a linear search?
Which sorting does collections sort use?
Explain implementation of deletion from a binary tree.
Is it legal to initialize list like this?
What is the difference between collection and collections?
What is mean by selection sort?
What is tree in computer science?
What are the objectives of studying data structures?
Parenthesis is never required in postfix or prefix expressions, why?
Why set will not allow duplicates?