Search
×

Sign up

Use your Facebook account for quick registration

OR

Create a Shvoong account from scratch

Already a Member? Sign In!
×

Sign In

Sign in using your Facebook account

OR

Not a Member? Sign up!
×

Sign up

Use your Facebook account for quick registration

OR

Sign In

Sign in using your Facebook account

Shvoong Home>Books>Sorting Methods in 'C' Language Review

Sorting Methods in 'C' Language

Book Review   by:DrRahulDeole     Original Author: Dr Rahul Deole
ª
 
SORTING METHODS IN C PROGRAMMING Dr RAHUL DEOLE -Computer/IT Expert -Tata Consulting Engineers Ltd email- rahuldeole@yahoo.com Sorting techniques-:“ To Arrange the element list in ascending /descending order is called as sorting Techniques” TYPES OF SORTING 1) BUBBLE SORTING TECHINQUES 2) INSERTION SORTING TECHINQUES 3) SELECTION SORTING TECHINQUES 4) QUICK SORTING TECHNIQUES 5) MERGE SORTING TECHINQUES 6) HEAP SORTING TECHINQUES 7) SHELL SORTING TECHNINQUES 1) Bubble sorting techniques -“ In this method basic idea is to compare two adjoining values and exchange them or swap them if they are not in proper order ,then start back at the beginning comparing &swapping if necessary continues the processes of n passess until series is a[1] ------------ a[n] is orted list" program in ‘c’ is given below for bubble sorting mtehod #include<stdio.h> #include<conio.h> Void main() { long int bubb_sort(); clrscr(); printf("\n ### BUBBLE SORTING METHOD ###\n"); bubb_sort(); getch(); } long int bubb_sort() { int n,a[15],i,j,temp; printf("\n Enter the Number of elements to be sorted \n"); scanf("%d",&n); printf("\n ENTER THE ELEMENTS NOW\n"); for(i=0; i<=n; i++) { scanf("%d",&a[i]); getch();} for(i=0; i<=n; i++) { for(j=i+1; j<=n; j++) { if (a[i] > a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; }} } printf("\n SORTED ARRAY AFTER BUBBLE SORTING \n"); for(i=0; i<=n; i++) { printf("\t\t %d",a[i]); getch();} }
Published: February 27, 2006   
Please Rate this Review : 1 2 3 4 5
  1. Answer   Question  :    please tell difference in all type of sortings View All
  1. Answer   Question  :    sort techniques in AND ITS IMPLMENTATION IN C LANGUAGE View All
  1. Answer   Question  :    please tell,differance in all types of sorting View All
  1. Answer   Question  :    Find out the quick sort in the following list: 8,3,2,9,7,1,5,4 ( 1 Answer ) View All
  1. Answer  :    fortheaboveelementsfirsttakethe1stelementasthepivotelement andcompareitwiththelastelementi.e.,8with4iftheelementislessthanthepivotelementtheninterchangetheelementswhenpivotisleft uhavetocomparewiththerightmostelementandwhenitisatrightside comparewiththeleftmostelementwhenwholetheelementsarecomparedonesthentheelemetnslessthanpivotoccurattheleftsideandgreaterthanpivotcomesatrightsidethenagaintakeleftelementsasarray anddothesameprocessuntill all the elemts comes under sorted list............ Sunday, August 21, 2011
  1. Answer   Question  :    Find out the merge sort in the following list: 8,3,2,9,7,1,5,4 View All
  1. Answer   Question  :    Find out the selection sort in the following list: 8,3,2,9,7,1,5,4 ( 1 Answer ) View All
  1. Answer  :    hi Monday, July 25, 2011
  1. Answer   Question  :    Find out the insertion sort in the following list: 8,3,2,9,7,1,5,4 View All
  1. Answer   Question  :    Find out the bubble sort in the following list: 8,3,2,9,7,1,5,4 View All
  1. Answer   Question  :    Find out the bubble sort, insertion sort, selection sort, merge sort, quick sort in the following list: 8,3,2,9,7,1,5,4 View All
  1. Answer   Question  :    anyone please tell ans.what is sorting? ( 2 Answers ) View All
  1. Answer  :    to arrange the elements in an order of whether it is in ascending or descending..... Saturday, September 03, 2011
  1. Answer  :    To arrange systematically in groups Friday, April 29, 2011
Translate Send Link Print
X

.