Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

linkedlist javascript

class LinkedList {
    constructor(head = null) {
        this.head = head
    }
}

class ListNode {
    constructor(value,next=null){
        this.value = value;
        this.next = next;
    };
}

let node1 = new ListNode(2);
let node2 = new ListNode(4);
node1.next = node2;

let list = new LinkedList(node1);

console.log(list.head.next);
Source by ulvimmeedov.herokuapp.com #
 
PREVIOUS NEXT
Tagged: #linkedlist #javascript
ADD COMMENT
Topic
Name
8+3 =