Question: int List _ append ( List * pList, void * pItem ) { assert ( pList ! = NULL ) ; if ( pList -
int ListappendList pList, void pItem
assertpList NULL;
if pListsize LISTMAXNUMNODES
return LISTFAIL; List is full
int newNodeIndex pListavailable;
pListavailable pListnodespListavailablenext;
pListnodesnewNodeIndexdata pItem;
pListnodesnewNodeIndexnext ; No next node, as it is the last node
if pListsize
pListhead newNodeIndex;
else
int lastNodeIndex pListhead;
while pListnodeslastNodeIndexnext
lastNodeIndex pListnodeslastNodeIndexnext;
pListnodeslastNodeIndexnext newNodeIndex;
pListsize;
return LISTSUCCESS;
without malloc fix thisi code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
