ch 10/e10.c
//Function to sort an array of dictionary elements into alphabetical order - bubble sort

Function to sort an array of dictionary elements into alphabetical order - bubble sort
Function to sort an array of dictionary elements into alphabetical order - bubble sort
void sort_alpha ( struct entry list [], int noe )
 {
 	for ( int x = 0; x < noe; x++ )
	 {
	 	for ( int y = 0; y < noe - 1; y++ )
		 {
		 	if ( list[y].word[0] > list[y+1].word[0] )
			 {
			 	struct entry temp = list [y+1] ;
				list [y+1] = list [y] ;
				list [y] = temp ; 
			 } 
		 }
	 }
 }
void sort_alpha ( struct entry list [ ] , int noe ) { for ( int x = 0 ; x < noe ; x ++ ) { for ( int y = 0 ; y < noe - 1 ; y ++ ) { if ( list [ y ] . word [ 0 ] > list [ y + 1 ] . word [ 0 ] ) { struct entry temp = list [ y + 1 ] ; list [ y + 1 ] = list [ y ] ; list [ y ] = temp ; } } } }
Function to sort an array of dictionary elements into alphabetical order - bubble sort
Function to sort an array of dictionary elements into alphabetical order - bubble sort