Struct listnode {int m_nvalue; listnode * m_pnext;}; // Add node/* The first parameter is a pointer to the pointer. When we insert a node into an empty linked list, the newly inserted node is the head pointer of the linked list. Because the header pointer is changed at this time, you must set the phead parameter to the pointer */void addtotail (listnode ** phead, int value) {listnode * pnew = new listnode (); pnew-> m_pnext = NULL; pnew-> m_nvalue = value; If (* phead = NULL) {* phead = pnew ;} else {listnode * pnode = * phead; // use a temporary node to traverse the table to find the last base point while (pnode-> m_pnext) pnode = pnode-> m_pnext; pnode-> m_pnext = pnew;} void removenode (listnode ** phead, int value) {If (* phead = NULL | phead = NULL) return; listn Ode * ptobedelete = NULL; // put the node to be deleted into ptobedeleteif (* phead)-> m_nvalue = value) // If the header node is to be deleted {ptobedelete = * phead; * phead = (* phead)-> m_pnext; // change the header node} else {listnode * pnode = * phead; while (pnode-> m_pnext! = NULL & pnode-> m_pnext-> m_nvalue! = Value) {pnode = pnode-> m_pnext; // find the previous node of the deleted node} // find the node if (pnode-> m_pnext! = NULL & pnode-> m_pnext-> m_nvalue! = Value) {ptobedelete = pnode-> m_pnext; pnode-> m_pnext = pnode-> m_pnext; // adjust the node} If (ptobedelete! = NULL) {Delete ptobedelete; // delete node }}