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 a stack be described as a pointer? Explain.
How do you declare A pointer to array of three chars
What is the use of placement new?
When will you use array over arraylist?
Calculate the address of a random element present in a 2d array, given base address as ba.
Why arraylist is not efficient for manipulation?
What do you mean by balanced trees?
What is a treeset?
What is heap tree explain with example?
Does arraylist maintain order?
Is list an array?
What is a map programming?
Traverse the given tree using Inorder, Preorder and Postorder traversals. Inorder : D H B E A F C I G J Preorder: A B D H E C F G I J Postorder: H D E B F I J G C A
Which sort is stable?
Write a program for Sorting an Array. Which sorting will you prefer?