Question: please help this is c++ these functions have NO PARAMETERS Move the first two nodes (or more) to the end of the calling object. This

please help this is c++ these functions have NO PARAMETERS

  1. Move the first two nodes (or more) to the end of the calling object. This will require resetting pointer first, and last if it is a doubly-linked list, and all other necessary pointers to connect the list.
  2. Move the last two nodes (or more) to the front of the calling object. This will require resetting pointer first, and last if it is a doubly-linked list, and all other necessary pointers to connect the list.
  3. Search for specific values (all odds, all evens, all multiples of some integer, etc.) and return the number of occurrences.
  4. Search for specific values (all odds, all evens, all multiples of some integer, etc.) and add a node at the end (or beginning) of the list. The node will store the number of occurrences.
  5. Search for specific values (all odds, all evens, all multiples of some integer, etc.) and return true if at least one occurrence of that specific value is found.
  6. Rotate a list to the left (or right) by rotating the nodes. You will need to reset pointers.
  7. Rotate a list to the left (or right) by rotating the values stored in the nodes. No pointers will be reset.

___________________________________________________

class Node { public: Node() : data(0), next(nullptr) {} Node(int theData, Node *newNext) : data(theData), next(newNext){} Node* getNext() const { return next; } int getData( ) const { return data; } void setData(int theData) { data = theData; } void setNext(Node *newNext) { next = newNext; } ~Node(){} private: int data; Node *next; // Pointer that points to next node. };

class AnyList { public: AnyList() : first(nullptr), count(0) {}

void print() const;

void clearList(); ~AnyList();

private: Node *first; // Pointer to point to the first node in the list. int count; // Variable to keep track of number of nodes in the list. };

#endif

if possible these functions could be doubly linked list thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!