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

8
LINES

< > BotCompany Repo | #1023798 // simplyLinkedListToArray

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

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

1  
static O[] simplyLinkedListToArray(int n, Class type, SimplyLinkedList sll) {
2  
  O[] array = typedArray(type, n);
3  
  for i to n: {
4  
    array[i] = sll.head;
5  
    sll = sll.tail;
6  
  }
7  
  ret array;
8  
}

Author comment

Began life as a copy of #1023794

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023798
Snippet name: simplyLinkedListToArray
Eternal ID of this version: #1023798/1
Text MD5: 06cf3786ebf701ee4731c3be272c9f23
Transpilation MD5: 595d2780d8028f2f7adad5747bb03d78
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-09 03:37:12
Source code size: 199 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 259
Referenced in: [show references]