Untitled
unknown
plain_text
3 years ago
543 B
10
Indexable
std::string sortedList::printList() const{
std::string print{};
Node* currentNode = first;
if (this->isEmpty()){
print = "NULL.";
} else {
for (int i=0; i<size; i++)
{
if (i==size-1){ //Last iteration
print += std::to_string(currentNode->value) + " -> NULL.";
} else {
print += std::to_string(currentNode->value) + " -> ";
}
currentNode = currentNode->next;
}
}
return print;
} //prints the existing nodesEditor is loading...