We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45f1e39 commit 711ecc4Copy full SHA for 711ecc4
Arrays/P01_ReversingArray.py
@@ -0,0 +1,18 @@
1
+# Author: OMKAR PATHAK
2
+
3
+import Arrays
4
5
+def reversingAnArray(start, end, myArray):
6
+ while(start < end):
7
+ myArray[start], myArray[end - 1] = myArray[end - 1], myArray[start]
8
+ start += 1
9
+ end -= 1
10
11
+if __name__ == '__main__':
12
+ myArray = Arrays.Array(10)
13
+ myArray.insert(2, 2)
14
+ myArray.insert(1, 3)
15
+ myArray.insert(3, 1)
16
+ print('Array before Reversing:',myArray)
17
+ reversingAnArray(0, len(myArray), myArray)
18
+ print('Array after Reversing:',myArray)
0 commit comments