Start with the empty list
head = newNode ( 10 ) NEW_LINE head . next = newNode ( 4 ) NEW_LINE head . next . next = newNode ( 5 ) NEW_LINE head . next . next . next = newNode ( 30 ) NEW_LINE head . next . next . next . next = newNode ( 2 ) NEW_LINE head . next . next . next . next . next = newNode ( 50 ) NEW_LINE x = 3 NEW_LINE head = partition ( head , x ) NEW_LINE printList ( head ) NEW_LINE