Radix Sort
My post today was all about my final project in Data Structure and Algorithm. I already took Data Structure wayback when I was in Computer Engineering Technology. And I never thought that I will take this again because I expect more a lot on project development and system design. So I just want to share my final project but I will not include Binary Search because that algorithm was also included in my project. I edit the program to make it simple and remove graphics. What is so good with this program is that it has an iteration that was discussed on my Numerical Analysis class. I wonder how can I apply more my Mathematics skills on my developer's track. 
#include<stdio.h>
#include<math.h>
#define MAX 13 /* Initialize 13 numbers so that we can see that the program was actually sorting*/
#define PTR_SIZE 10
typedef struct _node_var
{
int data;
struct _node_var *next;
}node_var;
void initialise ( node_var* [] );
void radix_sort ( int [], node_var* [] );
void refill_list ( int [], node_var* []);
void insert2q ( node_var* [], int, int);
void show ( int [] );
int del_q ( node_var* [] , int );
void main()
{
int list[13];
int ctd;
node_var *aux[PTR_SIZE];
clrscr();
initialise ( aux );
printf("Randomized list is :\n");
for (ctd=0;ctd<13;ctd++)
{
scanf ("%d",&list[ctd]);
}
show(list);
radix_sort ( list , aux );
printf("\n\nSorted list is :\n");
show(list);
}
void initialise ( node_var *aux[] )
{
int i;
for(i=0;i<PTR_SIZE;i++)
aux
= NULL;
}
void radix_sort ( int list[], node_var *aux[] )
{
int i, exp=0, j, max, nod =0,nth_d ;
/* FIND LARGEST NUMBER IN ARRAY */
max = list[0];
for(i=0;i<MAX;i++)
if(list
> max )
max = list
;
/* FIND NO. DIGITS IN MAX */
while(max > 0 )
{
nod++;
max = max / 10;
}
for( i=0; i<nod; i++)
{
exp++;
for(j=0;j<MAX;j++)
{
nth_d = list[j] % (int)pow(10,exp);
nth_d = nth_d / (int)pow(10,exp-1);
insert2q( aux, nth_d , list[j] );
}
refill_list (list,aux);
printf("\n\nIteration %d :\n\t ",i+1); /*Includes iteration that was discussed on my Numerical Analysis Class*/
show(list);
}
}
void insert2q ( node_var *aux[] ,int i, int val )
{
node_var *temp,*rear;
temp = ( node_var * ) malloc ( sizeof (node_var) );
temp->data = val;
temp->next = NULL;
if(aux
==NULL)
{
aux
= temp;
rear = temp;
}
else
{ rear = aux
;
while(rear->next != NULL )
rear = rear->next;
rear->next = temp;
rear = temp;
}
}
void refill_list ( int list[] , node_var *aux[] )
{
int i, j=0;
for(i=0;i<PTR_SIZE;i++)
{
while(aux
!= NULL)
{
list[j] = del_q ( aux , i );
j++;
}
}
}
int del_q ( node_var *aux[] , int i )
{
node_var *temp;
temp = aux
;
aux
= aux
->next;
temp->next = NULL;
return temp->data;
}
void show ( int list[] )
{
int i;
for(i=0;i<MAX;i++)
printf("%8d",list
);
}
That's it! Well before I forgot, the blog seems to change my "[ i ]" array as a bulb symbol.