Hi.
when you see my code, it will go without saying I struggle with this-but I'm trying...
I have a LL class that has a data from a struct that holds
name and number.
I am trying to write the insert function so that the list is travered
and any new node is inserted in the appropriate alpha spot.
this is what I have:
any suggestions would be a help.Code:void TList::insert (Data&d) { TList* tptr = new TList; tptr->D = d; while (head->D.name < tptr->D.name) tptr=tptr->next; next = tptr; count++; }
also should I initialize head as NULL and say if the head is NULL
make the new node head?
thanks a bunch



LinkBack URL
About LinkBacks


