Form a model of double-linked circular list, make a description of it and develo
ID: 1947521 • Letter: F
Question
Form a model of double-linked circular list, make a description of it and develope list processingoperations:
a) Findith (advanced algorithm), InsertBefore, Delete (next element becomes a new current
element);
b) FindKey, InsertAfter, Update;
c) FindLast, Terminate, Delete (previous element becomes a new current element);
d) InsertBefore (not reduced to InsertAfter), Findkey, FindFirst.
Explanation / Answer
void CircularDLL::insertAfterLast (int id, string name, string email, int age) { Node* N=new Node; N->stId=id; N->stName=name; N->stEmail=email; N->stAge=age; Node* Q=top; while(Q->next!=top)//get to the last node { Q=Q->next; } coutprev=N; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.