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 time complexity of bubble sort?
How much time does it take to learn data structures?
What is the difference between array and stack?
What are linked lists used for?
How long does it take to master data structures and algorithms?
What is a height of a tree?
What is the difference between hashset and hashmap?
Define leaves?
Is arraylist a class?
Is binary tree a binary search tree?
What are b tree keys?
What is stable sort?
What is data in computer science?
Why is arraylist not thread safe?
Differentiate between arraylist and vector.