This is my Node Class:

```
class Node:
def __init__(self, initData, initNext):
    """ Constructs a new node and initializes it to contain
    the given object (initData) and link to the given next node. """

    self.data = initData
    self.cover = True
    self.next = initNext

    # Additional attributes

def getData(self):
    """ Returns the element """
    return self.data

def getNext(self):
    """ Returns the next node """
    return self.next

def getDisplay(self):
    #TODO
    if self.cover == True:
        return '_'
    elif self.cover == False:
        return self.data

def setData(self, newData):
    """ Sets newData as the element """
    self.data = newData

def setNext(self, newNext):
    """ Sets newNext as the next node """
    self.next = newNext

def setDisplay(self, newDisplay):
    #TODO
    if newDisplay == self.data:
        self.cover = False
    elif newDisplay != self.data:
        self.cover = True

```

I have a singly linked list that needs to be sorted with insertion sort. I have a good understanding of insertion sort with regular lists but not with linked lists. I found another post and a user said this:

> 
> Let's think about how Insertion Sort works: It "splits" (in theory) the list into three groups: the sorted subset (which may be empty), the current item and the unsorted subset (which may be empty). Everything before the current item is sorted. Everything after the current item may or may not be sorted. The algorithm checks the current item, comparing it with the next item. Remember that the first item after the current item belongs to the unsorted subset.
> 
> 
> Let's assume that you are sorting integers in increasing order (so given "3,1,5,2,4" you want to get "1,2,3,4,5"). You set your current item to the first item in the list. Now you begin sorting:
> 
> 
> If the next item is greater than the current item, you don't need to sort that item. Just make it "current item" and continue.
> 
> 
> If the next item is less than the current item then you have some work to do. First, save the next item somewhere - let's say in a pointer called temp - and then "remove" the next item from the list, by making current->next = current->next->next. Now, you need to find right place for the removed item. You can do this in two ways:
> 
> 
> Either start from the beginning of the list, going forward until you find the correct position. Once you do, you insert the item there and you continue your insertion sort. This is the simplest solution if you have a singly-linked list.
>  You go backwards, until you find the correct spot for the item. Once you do, you insert the item there and you continue your insertion sort. This is a bit more involved but can work well if you have a doubly-linked list.
>  You continue this process until you reach the end of the list. Once you reach it, you know that you have completed your insertion sort and the list is in the correct sorted order.
> 
> 
> I hope this helps.
> 
> 
> 

[Link of answer](https://stackoverflow.com/a/13444622/11112005) 

I have tried to make my code after this post, but do not know how to find the right place for the item and then insert it. This is my code:

```
def sort(self):
    head = self.linkedList.head
    current = head
    while current != None:
        if current.getNext().getData() > current.getData():
            current = current.getNext()
        else:
            temp = current
            current.setNext(current.getNext().getNext())
            #I am not sure what to do here

```

Can anyone help me?