Libraryless. Click here for Pure Java version (36L/1K).
1 | static int[] reverseIntArrayInPlace(int[] a) { |
2 | if (a == null) null; |
3 | for (int i = 0; i < a.length/2; i++) { |
4 | int temp = a[i]; |
5 | a[i] = a[a.length-1-i]; |
6 | a[a.length-1-i] = temp; |
7 | } |
8 | ret a; |
9 | } |
Began life as a copy of #1035038
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035041 |
Snippet name: | reverseIntArrayInPlace |
Eternal ID of this version: | #1035041/1 |
Text MD5: | 1fb883c8a962eecd139d61a7378ca409 |
Transpilation MD5: | 8e4178a2c51fd2b88cd24bb13edd89c2 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-25 21:03:38 |
Source code size: | 210 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 135 / 191 |
Referenced in: | [show references] |