Question: this is the complete question class Node: def _init__(self, next=None, prev=None, data=None): self.next - next selt.prev - prev self.data - data class DLL: def _init__(self):

 this is the complete question class Node: def _init__(self, next=None, prev=None,
data=None): self.next - next selt.prev - prev self.data - data class DLL:this is the complete question

class Node: def _init__(self, next=None, prev=None, data=None): self.next - next selt.prev - prev self.data - data class DLL: def _init__(self): self.head - None def push (selt, new_data): new_node - Node (data - new_data) new_node.next = self.head new_node.prev = None if self.head is not None: self.head.prev - new_node self.head = new_node def print DLL (self): temp - self.head while temp! -None: print (temp.data) temp temp.next [10 Marks) Question #1: Consider following code: class Node: def __init_(self, next=None, prev=None, data=None): self.next - next self.prev - prev self.data-data class DLL: def _init__(self): self.head = None def push(self, new_data): new_node - Node (data - new_data) new_node.next = self.head new_node.prev = None if self.head is not None: self.head. prev = new_node self.head - new_node def print DLL (self): temp - self.head while temp!=None: print (temp.data) temp - temp.next Write a function named 'deleteDivisibleNodes' which will delete all nodes from the doubly linked list which are divisible by K. Pass K as an argument to the function. Input: List = 15 16 6 7 17, K = 2 Output: Final List = 15 7 17 Input: List = 5 3 4 2 9, K = 3 Output: Final List = 5 4 2

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!