I have a project to do where I have to change SLList to LispList and add a few other functions. My only question is that My prof. has asked us not to create new nodes for a function called rest(), where the rest list is returned without the head.
Node* rest(){
Node* nextToHead = head -> next; //this is a pointer to the next node in the list
return nextToHead;
}
by using the pointer nextToHead, will it point to the rest of the list as well? If not, it'll be great if you guys can give me tips on how to return the list without the head and without using any other nodes.