shell sort method with iterator to output the sorted vector