Set prev=head End the while loop Set tmp = tail Set curr = prev's next Set curr = tmp Set prev= curr 7 Set tail head 8 S
Posted: Mon Jun 06, 2022 2:23 pm
Set prev=head End the while loop Set tmp = tail Set curr = prev's next Set curr = tmp Set prev= curr 7 Set tail head 8 Set head = tmp 9 Set tail's next = null 10 Start a while loop that runs as long as curr is not null 11 Set tmp = curr's next 12 Set curr's next = prev 1 2 3 4 5 6