rendered paste bodybool List::InsertSorted(const DataType& data){ Node* tmp = NULL; // No nodes in the list if (myHead == 0 || lexicographical_compare(data.begin(), data.end(), myHead->GetData().begin(), myHead->GetData().end())) { myHead = new Node(data, myHead); myCurrent = myHead; return true; } for (tmp = myHead; tmp != NULL; tmp = tmp->GetNext()) { if (lexicographical_compare(data.begin(), data.end(), tmp->GetData().begin(), tmp->GetData().end())) { myCurrent = new Node(data, tmp); myCurrent->SetNext(tmp); return true; } tmp = tmp->GetNext(); } tmp->SetNext(new Node(data, tmp)); return true;}