Question: Need help adding a get min, max and average method to this program in python. Thanks! class Node: def __init__(self,init_data): #initialization data has inital data

Need help adding a get min, max and average method to this program in python. Thanks!

class Node: def __init__(self,init_data): #initialization data has inital data and next has none self.data=init_data self.next=None def get_data(self): return self.data def get_next(self): #next is a variable return self.next #setting new data like 5 to 7(next in list) def set_data(self,new_data): self.data=new_data #link to new next from previous none def set_next(self,new_next): self.next=new_next #creating the node with 93 and print the get data new=Node(93) #print(new.get_data()) #linked list class class Linkedlist: def __init__(self): self.head=None def add(self,item): temp=Node(item) temp.set_next(self.head) self.head=temp def size(self): current=self.head count=0 while current != None: count=count+1 current=current.get_next() return count myList=Linkedlist() myList.add(83) myList.add(43) myList.add(64)

Need help adding a get min, max and average method to this

class Node: def init_(self,init_data): #initialization data has inital data and next has none self.data-init_data self.next None def get_data(self): return self.data def get_next(self): #next is a variable return self.next #setting new data like 5 to 7(next in list) def set_data(self,new_data): self.data-new data #link to new next from previous none def set_next (self,new_next): self.next-new next #creating the node with 93 and print the get data new Node (93) #print (new, get-data( ) ) #linked list class -class Linkedlist: def-init-(self): self.head None def add(self,item): temp-Node (item) temp.set next (self.head) self.head-temp def size(self): current-self.head count= while current != None: count-count+1 current-current.get_next() return count myList-Linkedlist() myList.add(83)

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!