Skip to content

Instantly share code, notes, and snippets.

View Nwillia3's full-sized avatar

Neil Williams Nwillia3

  • New York, New York
View GitHub Profile
@bradtraversy
bradtraversy / js_linked_list.js
Last active July 20, 2025 19:42
JS Linked List Class
// Construct Single Node
class Node {
constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
// Create/Get/Remove Nodes From Linked List
class LinkedList {
@primaryobjects
primaryobjects / linkedList.js
Last active November 6, 2019 11:28
Reverse a Linked List in JavaScript.
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}