**ratheeshnellikkal**
Answered On : Nov 6th, 2007

among the sorting algorithms quick sort is the best one

Login to rate this answer.

Sorting techniques

Bubble sort

Selection sort

Insertion sort

Quick Sort

Heap Sort

Bucket Sort

Hashing technique.

BST could be classified as a sorting technique.

The best sorting technique for a particular problem largely depends upon the problem at hand ( domain and size of the problem ) and the resources available ( memory, CPU and time ).

Heap sort has the least worst case complexity.

Login to rate this answer.

There are a few other sorting algorithms which are distribution based algorithms. Examples of these are Bucket Sort, Counting Sort, and Radix sort which can operate O(n) depending on the the input.

1 User has rated as useful.

Login to rate this answer.

There are various Sorting techniques

They are Internal and External Sorting.

Various Internal sorting tecniques are as follows:

Bubble sort

Insertion sort

Selection sort

Quick sort

Merge sort

Heap sort

Radix sort

bucket sort

Shell sort

For small input size shell sort is best choice

Login to rate this answer.

Shell Sort, Radix Sort

The complexity is depend on the given data

If it is in sorted order insertion sort is best one and quick is worst

If not quick shows good results etc.

So it is just depend on the order of given data

Login to rate this answer.

HEAP sort is the best algorithm

O(n log n) time for best, avg and worst case

O(1) space

let me know if any other sorting algorithm present if that exceeds the limit i gave

Login to rate this answer.

**akshay**
Answered On : Aug 25th, 2011

BUBBLE SORT:

Code

BUBBLE SORT:

#include<iostream.h>

#include<string.h>

#include<math.h>

#include<stdlib.h>

void main()

{

int a[10],n,temp;

cout<<"Enter number of elements:";

cin>>n;

cout<<"Enter no's: "<<endl;

for(int i=0;i<n;i++)

{

cin>>a[i];

}

cout<<"Sorted list is:";

for(int m=0;m<n-1;m++)

{

for(int p=m+1;p<n;p++)

{

if(a[p]<a[m])

{

temp=a[p];

a[p]=a[m];

a[m]=temp;

}

}

}

for(int x=0;x<n;x++)

{

cout<<a[x]<<endl;

}

}

Login to rate this answer.