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
Which sorting algorithm is considered the fastest?
Differentiate between an array and an arraylist.
What is the space complexity of quicksort?
What is data structure and its operations?
Design a datastructure to represent the movement of a knight on a chess board
Tell me about the different sorting techniques.
Which collection is used for sort?
Write a data structure for a queue.
Which language is best for learning data structures and algorithms?
Are duplicates allowed in list?
Can you please explain the difference between array_name and &array_name?
What are the average and worst time complexity in a sorted binary tree is
How do you declare An array of three char pointers
What is numeric array?
What is reduction to sorting method?