Question: Please help me create a Node and singly Link List with the functions given, using C++ programming language? 1.Introduce a Node class that can store

Please help me create a Node and singly Link List with the functions given, using C++ programming language?

1.Introduce a Node class that can store integer data and the address of next Node.

2.Introduce a SLL (Singly Linked List class) with the following functions

a.constructor

b.void print(); print all the values of a SLL.

c.int size(); return the number of nodes of a SLL.

d.void insertToFront(int); insert a new node with int value to the beginning of a SLL.

e.void insertToEnd(int); insert a new node with int value to the end of a SLL.

f.void insertToMiddle(int); insert a new node with int value before the middle of a SLL. If this SLLs size is even, insert before the rightspotoftwo middle nodes. For example, assume SLL looks like 1 -> 2 -> 3 -> 4. Calling this function will insert a new node in between 2 and 3 nodes.

g.void deleteATargetNode(int target); delete firstNode that has target value.

h.Void deleteALLtargetNodes(int target); delete all Nodes that has target values.

i.Call the above functions in mainand see if they are correct.

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!