Question: CMPUT 175 - Lab 7: Linked Lists Goal: Learn about singly and doubly-linked lists, and learn to test your methods using assert statements rather than

CMPUT 175 - Lab 7: Linked Lists Goal: Learn about singly and doubly-linked lists, and learn to test your methods using assert statements rather than comparing to sample output. Exercise 1: In this task, you will complete the insert(pos, item) method for the singly-linked list. Recall that insert adds a new node (containing the item as its data) at the given position in the list. For example, if pos is 0, then the new node goes at the beginning (head) of the list. pos must be an integer, and for this exercise, cannot be negative. 1. Download and save SLinkedList.py from eClass. There are 2 classes in the file: the SLinkedListNode class, and the SLinkedList class. The SLinkedListNode class is already completed for you, based on the implementation in the lecture. The SLinkedList class is partially completed - you must complete the implementation of the insert method, and use the code in the main function to test it. Hints: . Think of the different cases you may encounter. What if you try to insert into a

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!