reverse linked list with chunk size and elements of list as input