UNPKG

es-next-tools

Version:

A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.

22 lines (21 loc) 561 B
/** * Represents a binary search tree. * @template T The type of elements in the tree. */ export declare class BinarySearchTree<T> { private root; /** * Inserts a value into the tree. * @param {T} value - The value to insert. */ insert(value: T): void; /** * Searches for a value in the tree. * @param {T} value - The value to search for. * @returns {boolean} True if found, false otherwise. */ search(value: T): boolean; delete(value: T): boolean; height(): number; countNodes(): number; }