Hi Karlina,
What does p=q do ? Does p stand for pointer and q for query?
while (q)
{
if (count == position)
{
p -> next = q -> next; <- This i get
delete q;
listLength--;
cout << "Success: node at position " << position << " was deleted." << endl;
cout << "listLength = " << listLength << endl;
return true;
}
p = q; <- What is happening here?
q = p -> next;
count++;
Hi Karlina,
What does p=q do ? Does p stand for pointer and q for query?
while (q)
{
if (count == position)
{
p -> next = q -> next; <- This i get
delete q;
listLength--;
cout << "Success: node at position " << position << " was deleted." << endl;
cout << "listLength = " << listLength << endl;
return true;
}
p = q; <- What is happening here?
q = p -> next;
count++;