Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Assume that following initialization is given in your structure allStudent[5] and data is sorted based on name field,

 

struct studInfo

{   int    stNr;

    char name[10]  ;

    int    grade;

};

int main()                              // already sorted base on name field

{

 struct studInfo  allStudent[5]={    97790, “ADEM”  , 77,             

                                                                     963582, “AFGAR” ,  85,

                                                                     957434 ,”AHMED”,  100,

                                                                     921229 ,”BAKI” ,  65,

                                                                     971280 ,”ZEKI” , 88};

int n=5;/* Total number of students*/

char givenName[10];

gets(givenName);

k=binarySearch(………..);

….

sortBubble(……);

..

..

..

return 0;

}

 

  1. A) Write a C function named as binarySearch() and search a given student(get a name information from the monitor) in the given array allStudent[] , apply Binary Search , and list student information(stNr , name , grade).If student in not found give an error message in the main() program that “Student is not found”.

 

B)Write a C function named as sortBubble()  that will sort the student information  by Student Number(stNr) applying by Bubble Sort method, and after sort operation list sorted student information in the main program.

 

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY