RADIX - #include<stdio.h> # #include<conio.h>...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> #include<conio.h> # /* RISHI AGARWAL RADIX SORT ROLL NO 02 SE CMPN A */ * #define max 10 int x[max]; struct node { int data; struct node *next; }; } struct node *front[10],*rear[10],*start,*prev,*p; s void display(int a[],int n) { int i; printf("\nArray LIST\n"); for(i=0;i<n;i++) printf("%d ",a[i]); } void dis(struct node *z) { struct node *q; q=z; printf("Temp LIST:"); while(q!=NULL) { printf(" %d",q->data); q=q->next; } } int largest(int x[],int n) { int q,i,t; q=x[0]; for(i=1;i<n;i++) { if(q<x[i]) q=x[i]; } t=q; i=0; while(t>0) { t=t/10; i++; } return i; } void dispbuc(struct node *f,struct node *r)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
{ struct node *q; q=f; printf("LIST:"); if(f!=NULL) { while(q!=NULL) { printf(" %d",q->data); if(q==r) break; q=q->next; } } else { printf(" ***"); } } void radixsort(int x[],int n) { int i,j,k,exp,l,y,z,p1=0,m; start=NULL; m=largest(x,n); // printf("Digits in Largest:%d",m); for(i=0;i<n;i++) { p=(struct node *)malloc(sizeof(struct node)); p->data=x[i]; p->next=NULL; if(start==NULL)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/25/2010 for the course CMPN SEM4 taught by Professor Thakur during the Spring '07 term at University of Mumbai.

Page1 / 4

RADIX - #include&lt;stdio.h&gt; # #include&lt;conio.h&gt;...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online