learnMore-algorithm/src/main/java/com/learn/leetcode/LinkedlistIS.java
// function to sort a singly linked list using insertion sort 
function to sort a singly linked list using insertion sort
function to sort a singly linked list using insertion sort
void insertionSort(Node headref)
	{ 
		sorted = null; 
		Node current = headref;
		while (current != null) 
		{ 
			Node next = current.next;
			sortedInsert(current); 
			current = next; 
		} 
		head = sorted; 
	}
void insertionSort ( Node headref ) { sorted = null ; Node current = headref ; while ( current != null ) { Node next = current . next ; sortedInsert ( current ) ; current = next ; } head = sorted ; }
function to sort a singly linked list using insertion sort
function to sort a singly linked list using insertion sort
// Initialize sorted linked list  // Traverse the given linked list and insert every  // node to sorted  // Store next for next iteration  // insert current in sorted linked list  // Update current  // Update head_ref to point to sorted linked list 