@m3rashid/dsa-js
Version:
A data-structures and algorithms library for node and browser written in typescript. Inspired from C++ standard library
24 lines (23 loc) • 657 B
TypeScript
export declare class LinkedListNode<T> {
_data: T;
_next: LinkedListNode<T> | null;
constructor(data: T);
}
export declare class LinkedList<T> {
_head: LinkedListNode<T> | null;
_size: number;
constructor();
insertAtBeginning(data: T): boolean;
insertAtEnd(data: T): boolean;
insertAt(data: T, index: number): boolean;
removeFromBeginning(): boolean;
removeFromEnd(): boolean;
removeAt(index: number): boolean;
indexOfFirst(data: T): number;
indexOfLast(data: T): number;
isEmpty(): boolean;
size(): number;
printList(): void;
reverse(): void;
}
export declare const test: () => void;