algs-adt
Version:
An npm package for using data structures like queues or graphs in javascript or typescript
19 lines (18 loc) • 840 B
TypeScript
export declare abstract class List<Type> {
compareFunction: (e1: Type, e2: Type) => number;
protected constructor(compareFunction?: (e1: Type, e2: Type) => number);
abstract firstElement(): Type;
abstract lastElement(): Type;
abstract getElement(position: number): Type;
abstract addFirst(element: Type): void;
abstract addLast(element: Type): void;
abstract addElement(element: Type, position: number): void;
abstract deleteFirst(): Type;
abstract deleteLast(): Type;
abstract deleteElement(position: number): Type;
abstract changeInfo(element: Type, position: number): Type;
abstract forEach(callback: (e1: Type) => any): void;
abstract size(): number;
abstract isEmpty(): boolean;
abstract subList(position: number, numberElements: number): List<Type>;
}