advanced sorting four stepsas illustrated in figure and implemented in lines - inserting the node into the new ordered list is handled by the addtosortedlist(functionwhich simply implements the operation from listing figure illustrates the results after each of the remaining iterations of the insertion sort algorithm when applied to our sample linked list the insertion sort algorithm used with linked lists is ( in the worst case just like the sequence-based version the differencehoweveris that the items do not have to be shifted to make room for the unsorted items as they are inserted into the sorted list insteadwe need only modify the links to rearrange the nodes newlist origlist curnode (acurnode origlist newlist (bcurnode origlist newlist (cnewlist origlist (dfigure the individual steps performed in each iteration of the linked list insertion sort algorithm(aassign the temporary reference to the first node(badvance the list reference(cunlink the first nodeand (dinsert the node into the new list