Iterative selection sort for linked list |  ; Traverse the List ; Traverse the unsorted sublist ; Swap Data
def selectionSort ( head ) : NEW_LINE INDENT temp = head NEW_LINE while ( temp ) : NEW_LINE INDENT minn = temp NEW_LINE r = temp . next NEW_LINE while ( r ) : NEW_LINE INDENT if ( minn . data > r . data ) : NEW_LINE INDENT minn = r NEW_LINE DEDENT r = r . next NEW_LINE DEDENT x = temp . data NEW_LINE temp . data = minn . data NEW_LINE minn . data = x NEW_LINE temp = temp . next NEW_LINE DEDENT DEDENT