Implement Shell sort