The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
What is wrong with my sorting function? head is a global variableÂ
void medianscore(){
struct student *sort=head,*temp,*sort1=head;
struct student *k=head;
struct student *la=head;
while(sort!=NULL){
    while(la!=NULL){
    printf("While loopn");
    if(sort->grade>la->grade){
        temp=sort->next;
        la->next=sort->next->next;
        sort=temp;
}
   else{
        sort=sort->next;
        la=la->next;
}
}
}
struct student *j=head;
while(j!=NULL){
printf("First name: %5s %2d, Last name: %5s %2d, Score: %5.2f %2d, Zipcode: %5d %2dn",j->firstname,count,j->lastname,count,j->grade,count,j->zip,count);
j=j->next;
}
}
-----------