Suppose I want to send a list in python and I will have a MyList class that will have 3 constructors. sending an empty list would return nothing, sending a list would convert it into a linked list and sending a linked list will copy its item and make another linkedlist from it
Task 1: i) Create a Node class that will hold two fields i.e an integer element and a reference to the next Node. ii) Create a Linked list Abstract Data Type (ADT)named MyList.The elements in the list are Nodes consisting of an integer type key (all keys are unique) and a reference to the next node.
Task 2: Constructors:(3)
MyList ( ) Pre-condition: None. Post-condition: This is the default constructor of MyList class. This constructor creates an empty list.
b. MyList (int [] a) or Myst(a) Pre-condition: Array cannot be empty. Post-condition: This is the default constructor of MyList class. This constructor creates a list from an array.
c. MyList (MyList a) or MyList(a)
Pre-condition: List cannot be empty. Post-condition: This is the default constructor of MyList class. This constructor creates a list from another list.