Understand node-based sequential structures. Linked lists are O(1) insertion/deletion at known position, but O(n) access. Compare to arrays.
class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
// ...Understand node-based sequential structures. Linked lists are O(1) insertion/deletion at known position, but O(n) access. Compare to arrays.
class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
// ...