What are the various kinds of sorting techniques? Which is has least worst case?

These are some sorting techs,

bubble sort
quick sort
insertion sort
selection sort
merge sort
heap sort

tell me any more sorting is found..... ad which is best....

Questions by mikerich135   answers by mikerich135

Showing Answers 1 - 7 of 7 Answers

ratheeshnellikkal

  • Nov 6th, 2007
 

among the sorting algorithms quick sort is the best one

  Was this answer useful?  Yes

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.

  Was this answer useful?  Yes

sunils34

  • Jan 20th, 2008
 

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.

anjali9477

  • Jan 21st, 2008
 

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




  Was this answer useful?  Yes

rohini.nitd

  • Aug 16th, 2009
 

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

  Was this answer useful?  Yes

vinod148

  • Oct 23rd, 2009
 

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

  Was this answer useful?  Yes

akshay

  • Aug 25th, 2011
 

BUBBLE SORT:

Code
  1. BUBBLE SORT:

  2. #include<iostream.h>

  3. #include<string.h>

  4. #include<math.h>

  5. #include<stdlib.h>

  6. void main()

  7. {

  8.         int a[10],n,temp;

  9.         cout<<"Enter number of elements:";

  10.         cin>>n;

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

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

  13.         {

  14.             cin>>a[i];

  15.         }

  16.         cout<<"Sorted list is:";

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

  18.         {

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

  20.                 {

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

  22.                         {

  23.                           temp=a[p];

  24.                           a[p]=a[m];

  25.                           a[m]=temp;

  26.                         }

  27.  

  28.                 }

  29.  

  30.  

  31.         }

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

  33.         {

  34.                 cout<<a[x]<<endl;

  35.         }

  36.  

  37. }

  38.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions