I wrote a function that should reverse a list.
So far, I can reverse only two items, but no more. I checked and double checked and still can\'t find the problem. I e
Everyone must have the same homework assignment today.
I think it would be more helpful to these people to show them what happens to the state of the list while it is being reversed. This should help them better than showing them code or code problems.
Here is what should happen (with the algorithm I would use)
[] = head () = current
([1])->2->3->4, [2]->(1)->3->4, [3]->2->(1)->4, [4]->3->2->(1) done because current now doesn't have a new next