Answered You can hire a professional tutor to get the answer.
sort(): Implement a method that uses Insertion Sort to sort nodes of a linked list. The list nodes will only contain letter strings as their data.
Insertion Sort
Note: this is fully implemented, only need to create sort() function!)
: :self.head = self.size = : self.head == : self.size :temp = Node(item, )temp.setNext(self.head)self.head = tempself.size += :current = self.headfound = current != found: current.getData() == item:found = :current = current.getNext() found :current = self.headfound = index = current != found: current.getData() == item:found = :current = current.getNext()index = index + found:index = index :current = self.headprevious = found = found: current.getData() == item:found = :previous = currentcurrent = current.getNext() previous == :self.head = current.getNext():previous.setNext(current.getNext())self.size -= found :temp = Node(item, ) self.head == :self.head = temp:current = self.head current.getNext() != :current = current.getNext()current.setNext(temp)self.size += :current = self.headprevious = current.getNext() != :previous = currentcurrent = current.getNext() previous == :self.head = :previous.setNext()self.size -= current.getData() : self.head