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

6
LINES

< > BotCompany Repo | #1004784 // swapElements - swap two elements of a list

JavaX fragment (include)

1  
static void swapElements(L l, int i, int j) {
2  
  if (i == j) ret;
3  
  O o = l.get(i);
4  
  l.set(i, l.get(j));
5  
  l.set(j, o);
6  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004784
Snippet name: swapElements - swap two elements of a list
Eternal ID of this version: #1004784/1
Text MD5: f691bb0e7a2d85ef1143875f8735d35d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-30 22:56:22
Source code size: 126 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 573 / 645
Referenced in: [show references]