MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / get

Method get

Data-Structures/Linked-List/SinglyLinkedList.js:239–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237
238 // Method to get the LinkedList
239 get() {
240 const list = []
241 let { currentNode } = this.initiateNodeAndIndex()
242 while (currentNode) {
243 list.push(currentNode.data)
244 currentNode = currentNode.next
245 }
246 return list
247 }
248
249 // Method for Rotating a List to the right by k places
250 rotateListRight(k) {

Callers 6

addEdgeMethod · 0.45
printGraphMethod · 0.45

Calls 2

initiateNodeAndIndexMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected