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


< > BotCompany Repo | #1014941 // replaceRandomElement

JavaX fragment (include)

static <A> void replaceRandomElement(L<A> l, A newElement) {
  if (empty(l)) ret;
  l.set(random(l(l)), newElement);

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014941
Snippet name: replaceRandomElement
Eternal ID of this version: #1014941/1
Text MD5: 64f8e141ccf6ab28197a4f7f06fdb648
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-06 16:45:10
Source code size: 121 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 304 / 347
Referenced in: [show references]