Driver program to test above functions .
public static void main ( String [ ] args ) { int arr [ ] = { 34 , 2 , 10 , - 9 } ; gnomeSort ( arr , arr . length ) ; System . out . print ( " Sorted ▁ sequence ▁ after ▁ applying ▁ Gnome ▁ sort : ▁ " ) ; System . out . println ( Arrays . toString ( arr ) ) ; } }