Node

Users questions:Known to take the lead in the dynamic single node in the node list L when ordered by increasing integer values, try to write an algorithm to insert a value of X, node L in the table, so that L remains orderly.
Experts answer:voidinsert (structLNode ** p, ElemTypex) (strctLNode*s=*p,*t,*u;while(s!=NULL&&s- datanext;}u=(structLNode*)malloc(sizeof(structLNode));if(s==NULL){t- next=u;u- next=NULL;}else{if(s==*p){u- next=s;*p=u;}else{u- next=s;t- next=u;}}
  • This information provided by the users.Thanks!