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
List the types of tree.
Are linked lists useful?
Define a binary tree?
Why we need cursor implementation of linked lists?
Write an algorithm to check if there is a loop in a doubly linked list.
Explain what are the methods available in storing sequential files ?
What are the different types of data structures?
What is dynamic array in excel?
How does a treemap sort?
Define secondary clustering?
What is the slowest sorting algorithm?
Give one example of right rotation.
How do you find the length of an arraylist?
What is the best case complexity of quicksort?
Can we add elements to final list?