Answers for "linkedlist javascript"

0

linkedlist javascript

class LinkedList {
                value;
                next;
                constructor(value,next=null){
                    this.value = value;
                    this.next = next;
                };
            }
            const root = new LinkedList(10);
            root.next = new LinkedList(20);
            root.next.next = new LinkedList(30);
        
            console.log(root.next.next); 
            // Output LinkedList {value: 30, next: null}
Posted by: Guest on October-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language