UNPKG

reactive-actor

Version:
26 lines 822 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LinkedList = exports.insertLinkedListNode = void 0; const linked_list_node_model_1 = require("./linked-list-node.model"); function insertLinkedListNode(node, data) { if (!node.next) { node.next = new linked_list_node_model_1.LinkedListNode(data); return; } return insertLinkedListNode(node.next, data); } exports.insertLinkedListNode = insertLinkedListNode; class LinkedList { constructor() { this.root = null; } add(data) { if (!this.root) { this.root = new linked_list_node_model_1.LinkedListNode(data); return; } insertLinkedListNode(this.root, data); } } exports.LinkedList = LinkedList; //# sourceMappingURL=linked-list.model.js.map