You are viewing a single comment's thread. Return to all comments →
c# :
public static List<int> reverseArray(List<int> a) { int[] arr = a.ToArray(); int j = arr.Length-1; for(int i = 0; i<arr.Length;i++) { int change = arr[i]; if (j > i) { arr[i] = arr[j]; arr[j] = change; j--; } } return arr.ToList(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays - DS
You are viewing a single comment's thread. Return to all comments →
c# :