Shell sort algorithm