Skip to content

Commit

Permalink
Merge pull request #46 from datastructures-js/fix_ts_types
Browse files Browse the repository at this point in the history
Fix ts types
  • Loading branch information
eyas-ranjous authored Nov 2, 2021
2 parents 74e9a83 + 419b885 commit 39a5a00
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/avlTree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { AvlTreeNode } from './avlTreeNode';

export class AvlTree<T extends number|string, U = undefined> extends BinarySearchTree<T, U> {
insert(key: T, value?: U): AvlTreeNode<T, U>;
find(key: T): AvlTreeNode<T, U>;
max(node?: AvlTreeNode<T, U>): AvlTreeNode<T, U>;
min(node?: AvlTreeNode<T, U>): AvlTreeNode<T, U>;
lowerBound(k: T, includeEqual?: boolean): AvlTreeNode<T, U>;
floor(k: T, includeEqual?: boolean): AvlTreeNode<T, U>;
upperBound(k: T, includeEqual?: boolean): AvlTreeNode<T, U>;
ceil(k: T, includeEqual?: boolean): AvlTreeNode<T, U>;
root(): AvlTreeNode<T, U>;
find(key: T): AvlTreeNode<T, U> | null;
max(node?: AvlTreeNode<T, U>): AvlTreeNode<T, U> | null;
min(node?: AvlTreeNode<T, U>): AvlTreeNode<T, U> | null;
lowerBound(k: T, includeEqual?: boolean): AvlTreeNode<T, U> | null;
floor(k: T, includeEqual?: boolean): AvlTreeNode<T, U> | null;
upperBound(k: T, includeEqual?: boolean): AvlTreeNode<T, U> | null;
ceil(k: T, includeEqual?: boolean): AvlTreeNode<T, U> | null;
root(): AvlTreeNode<T, U> | null;
traverseInOrder(cb: (node: AvlTreeNode<T, U>) => void): void;
traversePreOrder(cb: (node: AvlTreeNode<T, U>) => void): void;
traversePostOrder(cb: (node: AvlTreeNode<T, U>) => void): void;
Expand Down
16 changes: 8 additions & 8 deletions src/binarySearchTree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { BinarySearchTreeNode } from './binarySearchTreeNode';
export class BinarySearchTree<T extends number|string, U = undefined> {
insert(key: T, value?: U): BinarySearchTreeNode<T, U>;
has(key: T): boolean;
find(key: T): BinarySearchTreeNode<T, U>;
max(node?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
min(node?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
lowerBound(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U>;
floor(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U>;
upperBound(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U>;
ceil(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U>;
root(): BinarySearchTreeNode<T, U>;
find(key: T): BinarySearchTreeNode<T, U> | null;
max(node?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U> | null;
min(node?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U> | null;
lowerBound(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U> | null;
floor(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U> | null;
upperBound(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U> | null;
ceil(k: T, includeEqual?: boolean): BinarySearchTreeNode<T, U> | null;
root(): BinarySearchTreeNode<T, U> | null;
count(): number;
remove(k: T): boolean;
traverseInOrder(cb: (node: BinarySearchTreeNode<T, U>) => void): void;
Expand Down
16 changes: 8 additions & 8 deletions src/binarySearchTreeNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export class BinarySearchTreeNode<T extends number|string, U = undefined> {
constructor(key: T, value: U);
constructor(key: T, value?: U);
setKey(key: T): BinarySearchTreeNode<T, U>;
getKey(): T;
setValue(value: U): BinarySearchTreeNode<T, U>;
setValue(value?: U): BinarySearchTreeNode<T, U>;
getValue(): U;
setLeft(left: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getLeft(): BinarySearchTreeNode<T, U>;
setLeft(left?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getLeft(): BinarySearchTreeNode<T, U> | null;
hasLeft(): boolean;
setRight(right: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getRight(): BinarySearchTreeNode<T, U>;
setRight(right?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getRight(): BinarySearchTreeNode<T, U> | null;
hasRight(): boolean;
setParent(right: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getParent(): BinarySearchTreeNode<T, U>;
setParent(parent?: BinarySearchTreeNode<T, U>): BinarySearchTreeNode<T, U>;
getParent(): BinarySearchTreeNode<T, U> | null;
hasParent(): boolean;
isRoot(): boolean;
isLeaf(): boolean;
Expand Down

0 comments on commit 39a5a00

Please sign in to comment.