Write programs for Bubble Sort, Quick sort
Answer Posted / prashant gupta
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,t;
int a[7]={5,7,8,1,4,2,9}; // You can use any length
for(i=0;i<6;i++)
{
for(j=i+1;j<6;j++)
{
if(a[i]>a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
printf("The Sorted Array is = %d",a[i]);
getch();
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the best data structure and algorithm to implement cache?
How do you sort a collection in descending order?
What is time and space complexity of bubble sort?
State the properties of b tree.
Can we search the data in a linked list?
Which is the parent class of deque
How is the front of the queue calculated ?
Is arraylist fail fast?
Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.
How does hashset work internally in java?
What do you mean by tree edge?
How do you use the sort function?
Why quicksort is faster?
Which file contains the definition of member functions?
what are the applications that use Linked lists?