CAN SOMEONE PLEASE EXPLAIN WHAT IS HAPPENING HERE . THANK YOU (c ++ linked list ) THE CHECKNODE METHOD CHECKS IF THE REC

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

CAN SOMEONE PLEASE EXPLAIN WHAT IS HAPPENING HERE . THANK YOU (c ++ linked list ) THE CHECKNODE METHOD CHECKS IF THE REC

Post by answerhappygod »

CAN SOMEONE PLEASE EXPLAIN WHAT IS HAPPENING HERE .
THANK YOU (c ++ linked list )
THE CHECKNODE METHOD CHECKS IF THE RECORD ALREADY
EXISTS
Can Someone Please Explain What Is Happening Here Thank You C Linked List The Checknode Method Checks If The Rec 1
Can Someone Please Explain What Is Happening Here Thank You C Linked List The Checknode Method Checks If The Rec 1 (86.95 KiB) Viewed 28 times
31 void InsertEmpRecord(int EmploId, string EName, string EmpAddress, 32 int WorkHrs, int phoneNo, string firstDay, int EmpSalary) 33 { 34 if (checkNode (Emploid)) { 35 cout << "Employee Already Exists\n"; 36 return; 37 } 38 employeeNode1* empt = new employeeNode1(); 39 empt->EmploId EmploId; 40 empt->EName EName; 41 empt->EmpAddress= EmpAddress; 42 empt->WorkHrs WorkHrs; 43 empt->phoneNo=phoneNo; 44 empt->firstDay=firstDay; 45 empt ->EmpSalary=EmpSalary; 46 empt->next NULL; = =

== = = 47 48 if (headnode NULL|| (headnode->Emploid >= empt->Emploid)) { 49 empt->next headnode; 50 headnode empt; 51 } 52 else { 53 employeeNode1* empc headnode; 54 while (empc->next != NULL&& empc->next->Emploid < empt->EmploId) { empc->next; 56 } 57 empt->next empc->next; 58 empc->next empt; 59 } 60 cout << "Employee Record Inserted\n"; 61 } 55 empc = =
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply