Question: No need to write Node class and Linkedlist class, just write the method. Solve the problems using python: 1.a) Given a singly circular list. Write

 No need to write Node class and Linkedlist class, just write

No need to write Node class and Linkedlist class, just write the method.

Solve the problems using python: 1.a) Given a singly circular list. Write the push method. "head" is the head of the list (which can be empty). "item" is the element to push. def push (head, item): return head \# return head at the end b) Given a doubly linked list. Write the push method. "head" is the head of the list (which can be empty). "item" is the element to push. def push (head, item): return head \# return head at the end c) Complete the following function that takes an array of integers and returns an auxiliary array. The input values might contain negative values or might not. Your code should be able to handle both scenarios. def createAux(input): return AUX d) Given a circular array, its start and size, and head you have to write a recursive program that will create a singly linked list with the elements in reverse. The variable head will store the head of the final linked list which must be returned at the end. Note that the initial value of head is None. You are not allowed to take any global variables. You are allowed to change the value of start. Eg: if CIR =[x,y, None, None, a,b,c], start =4, size = 5 , head = None The final linked list will be look like - y,x,c,b, a head will point to y. def createlist (CIR, start, size, head) e) Complete the method below which takes a head of a singly list containing numbers in the form of strings. The method will generate a valid index number for a hashtable of length 5. The formula to generate the index is index =3 * (sum of each digit). ** If you think you need to change the formula you can do ONE change. (change includes edit, delete or add) def findindex (head): \# print each index

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!