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 the queue data structure.
Is priority queue sorted?
Tell me can the size of operator be used to tell the size of an array passed to a function?
What are linked list?
What is data structure geeksforgeeks?
State the rules to be followed during infix to prefix conversions?
What do you mean by shortest path?
Why insertion is faster in linked list?
Suppose in an integer array, there is 1 to 100 number, out of one is duplicate, how to find?
Why it is said that searching a node in a binary search tree is efficient than that of a simple binary tree?
List the data structures which are used in rdbms, network data modal, and hierarchical data model.
What does it mean to sort an array?
Which file contains the definition of member functions?
How do you find the height of a binary tree?
What is fibonacci search?