Home / Questions / What is wrong with my sorting function?
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;
}
}
Nov 07 2017 Read more Less More
Review of Chapters 7 and 8, 3-variance analysis. (CPA, adapted) The Beal Manufacturing Company’s costing system has two direct-cost categories: direct materials and direc...
Jul 19 2020Consider a company faced with a competitor's price reduction. Should the company also reduce price in order to maintain market share or should the company maintain its c...
Sep 03 2020Wald Inc's stock has a required rate of return of 10 and it sells for 40 per share Wald's dividend is expected to grow at a constant rate of 7 per year What is the expect...
May 06 2020The Physicians Foundation reported that 58 of all general practice The Physicians’ Foundation reported that 58% of all general practice physicians in the United States d...
Apr 21 2020Describe how a GSS can be used at your school or university
Jul 15 2020On Time Delivery Service had the following selected transactions during November: 1. Received cash from issuance of common stock, $75,000. 2. Paid rent for November, $5,0...
Apr 21 2020xhibit EE-2 depicts the production possibilities curves of wheat and corn for Nabia and Pada. If these two nations trade, Pada should special...
Dec 14 2019The numbers of insured commercial banks y (in thousands) in the United States for the years 1987 to 1996 are shown in the table. (Source: Federal Deposit Insurance Corpor...
Aug 01 2020Suppose the corn market has the following equations: QD = 3000 - 400P QS = 900 + 300P Where QD and QS are quantity demanded and quantity supplied measured in bushels, and...
Apr 17 2020The summarized balance sheet of Separate Company on January 1, 20X3, contained the following amounts: On January 1, 20X3, Joint Corporation acquired 70 percent of the c...
Jul 09 2020Welcome to MyCourseHelp Services, World's leading Academic solutions provider with Millions of Happy Students.