Question: Objective: In this assignment, you will implement and perform basic operations on a singly linked list. The goal is to reinforce your understanding of how
Objective:
In this assignment, you will implement and perform basic operations on a singly linked list. The
goal is to reinforce your understanding of how linked lists work and to practice manipulating
nodes.
Tasks:
points Node Class:
Implement a Node class that contains:
An integer data
A pointerreference to the next Node
points Linked List Class:
Implement a LinkedList class that contains:
A pointerreference to the head node of the list initialized as None
points Insert at Head:
Implement a method insertatheaddata that inserts a new node with the given data at
the beginning of the list.
points Insert at Tail:
Implement a method insertattaildata that inserts a new node with the given data at the
end of the list.
points Delete a Node:
Implement a method deletenodedata that searches for the first occurrence of a node
with the specified data and deletes it from the list. If the node does not exist, return a message
indicating this.
points Display the List:
Implement a method display that prints out all the elements in the linked list in order.
points Search for an Element:
Implement a method searchdata that returns True if the given data is present in the list
and False otherwise.
Bonus Task Optional points:
Implement a method reverse that reverses the linked list in place.
Submission Instructions:
Submit your LinkedList class implementation along with test cases that demonstrate the
functionality of each operation.
Make sure to comment your code and explain each method.
Provide output screenshots of the test cases.
Grading Criteria:
Correctness of implementation : points
Proper use of linked list operations : points
Code readability and comments : points
Test cases and output screenshots : point
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
