Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1035041 // reverseIntArrayInPlace

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (36L/1K).

static int[] reverseIntArrayInPlace(int[] a) {
  if (a == null) null;
  for (int i = 0; i < a.length/2; i++) {
    int temp = a[i];
    a[i] = a[a.length-1-i];
    a[a.length-1-i] = temp;
  }
  ret a;
}

Author comment

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: 49 / 74
Referenced in: [show references]