### Deleting Nodes!

I have no IDEA how to delete nodes (or the entire list for that matter).

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758`` ``````private: void drawNode(Node^ myNode, int level) { // 1 Declare variables int x; int nodeDistance = nodeLength + arrowLength; // 2 calculate x coord of the corner x = headX+(nodeDistance * level); // 3 Create a rectangle Drawing::Rectangle nodeRect(x,headY,nodeLength,nodeHeight); // 4 Draw the Node g->FillRectangle(whiteBrush,nodeRect); g->DrawRectangle(blackPen,nodeRect); g->DrawLine(blackPen,x+nodeLength-15,headY,x+nodeLength-15,headY+nodeHeight); // 5 Draw next if (myNode->next) // 5.1 if next Node draw arrow { g->DrawLine(blackPen,x+nodeLength,headY+12,x+nodeDistance,headY+12); g->DrawLine(blackPen,x+nodeLength+25,headY+7,x+nodeDistance,headY+12); g->DrawLine(blackPen,x+nodeLength+25,headY+17,x+nodeDistance,headY+12); } else // 5.2 if there is no next Node draw null pointer g->DrawLine(blackPen,x+nodeLength-15,headY,x+nodeLength,headY+25); // 6 Draw nodeData g->DrawString(myNode->nodeData.ToString(),arialFont,blackBrush,x+5,headY+5); // 7 Label head node g->DrawString("Head",arialFont,blackBrush,headX,headY-20); // 8 Increment level level++; // 9 If next points to a Node go there and draw it if (myNode->next) drawNode(myNode->next, level); } private: System::Void btnInsert_Click(System::Object^ sender, System::EventArgs^ e) { if (Node::nodeCount < 7) { Node^ temp = gcnew Node; temp->next = head; head = temp; drawNode(head, 0); } else { MessageBox::Show("Only 7 nodes allowed."); btnInsert->Enabled = false; btnDelete->Enabled = true; } } private: System::Void btnDelete_Click(System::Object^ sender, System::EventArgs^ e) { //DELETEING CODE HERE } private: System::Void btnClear_Click(System::Object^ sender, System::EventArgs^ e) { //CLEARING LIST CODE HERE } }; }``````