MCPcopy Create free account
hub / github.com/careercup/CtCI-6th-Edition-JavaScript / append

Method append

chapter02/util/LinkedListX.js:29–40  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

27 }
28
29 append(value) {
30 let node = new Node(value);
31 // if list is empty
32 if (!this.head) {
33 this.head = node;
34 this.tail = node;
35 }
36 else {
37 this.tail.next = node;
38 this.tail = node;
39 }
40 }
41
42 prepend(value) {
43 let node = new Node(value);

Callers 3

removeDups.jsFile · 0.45
returnKthToLast.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected