Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/js/rbtree.ts>RBTree

A modern runtime for JavaScript and TypeScript.
Go to Latest
class RBTree
import { RBTree } from "https://deno.land/x/deno@v1.0.0/cli/js/rbtree.ts";

Constructors

new
RBTree(comparator: (a: T, b: T) => number)

Methods

find(data: T): T | null

Returns node data if found, null otherwise.

insert(data: T): boolean

returns true if inserted, false if duplicate.

min(): T | null

Returns null if tree is empty.

remove(data: T): boolean

Returns true if removed, false if not found.