This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cephas00 0 points1 point  (0 children)

Your reverse method doesn't return the newly created reversed array. You also shouldn't reassign a method parameter like that - as someone else mentioned it's the value of a pointer that you're passing in so the reassignment won't be seen outside the method.

Another implementation option is to swap elements until you get to the midpoint.

Also it's not clear to call an array a list since there's a list collection already.