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
Can hashmap have same key?
What is tree in computer science?
What is definition list?
Which data structures are applied when dealing with a recursive function?
Difference between calloc and malloc in data structures?
what is the difference between dynamic as well as non - dynamic data structures.
What is reduction to sorting method?
What is difference between map and hashmap?
Can we add duplicate keys in a hashmap?
Define secondary clustering?
What are linked lists most commonly used for?
Define left-in threaded tree?
In which matrix, we can use multilinked structures?
Is bucket sort stable?
How do you replace an element in an arraylist?