Given a linked list class defined as follows:
Write a member function remove(int i) to remove the element at position i. If i is equal to or greater than the length of the list (or less than 0) then the list should remain unchanged.
Code:
class NumberList
{
private:
struct Node
{
double value;
struct Node *next;
};
ListNode *head; //points to the first node public:
NumberList();
}
Comment