import type { Nullable } from '../types/Nullable'; export default class LinkedListNode { protected _nextNode: Nullable> protected _data: T; constructor(data: T, nextNode: Nullable> = null) { this._nextNode = nextNode; this._data = data; } getData(): T { return this._data; } setNextNode(node: Nullable>): void { this._nextNode = node; } getNextNode(): Nullable> { return this._nextNode; } }