From 54f6277ce2679d59cafd929b34477866d592d9f7 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Tue, 23 Jul 2024 13:05:43 +1000 Subject: [PATCH] chore(data-structures): remove redundant constructor examples (#5510) chore(data-structures): remove constructor examples --- data_structures/binary_heap.ts | 14 -------------- data_structures/binary_search_tree.ts | 16 ---------------- data_structures/red_black_tree.ts | 16 ---------------- 3 files changed, 46 deletions(-) diff --git a/data_structures/binary_heap.ts b/data_structures/binary_heap.ts index c3d82fa1b..c7fa807d9 100644 --- a/data_structures/binary_heap.ts +++ b/data_structures/binary_heap.ts @@ -66,20 +66,6 @@ export class BinaryHeap implements Iterable { /** * Construct an empty binary heap. * - * @example Creating an empty binary heap - * ```ts no-assert - * import { BinaryHeap } from "@std/data-structures"; - * - * const heap = new BinaryHeap(); - * ``` - * - * @example Creating a binary heap with a custom comparison function - * ```ts no-assert - * import { BinaryHeap, ascend } from "@std/data-structures"; - * - * const heap = new BinaryHeap(ascend); - * ``` - * * @param compare A custom comparison function to sort the values in the heap. By default, the values are sorted in descending order. */ constructor(compare: (a: T, b: T) => number = descend) { diff --git a/data_structures/binary_search_tree.ts b/data_structures/binary_search_tree.ts index 8cd146b13..5deb86a05 100644 --- a/data_structures/binary_search_tree.ts +++ b/data_structures/binary_search_tree.ts @@ -98,22 +98,6 @@ export class BinarySearchTree implements Iterable { /** * Construct an empty binary search tree. * - * @example Creating an empty binary search tree - * ```ts no-assert - * import { BinarySearchTree } from "@std/data-structures"; - * - * const tree = new BinarySearchTree(); - * ``` - * - * @example Creating a binary search tree with a custom comparison function - * ```ts no-assert - * import { BinarySearchTree, ascend } from "@std/data-structures"; - * - * const tree = new BinarySearchTree<{ price: number, name: string }>( - * (a, b) => ascend(a.price, b.price) || ascend(a.name, b.name) - * ); - * ``` - * * To create a binary search tree from an array like, an iterable object, or an * existing binary search tree, use the {@link BinarySearchTree.from} method. * diff --git a/data_structures/red_black_tree.ts b/data_structures/red_black_tree.ts index 23af2dafc..d626e760e 100644 --- a/data_structures/red_black_tree.ts +++ b/data_structures/red_black_tree.ts @@ -104,22 +104,6 @@ export class RedBlackTree extends BinarySearchTree { /** * Construct an empty red-black tree. * - * @example Creating an empty red-black tree - * ```ts no-assert - * import { RedBlackTree } from "@std/data-structures"; - * - * const tree = new RedBlackTree(); - * ``` - * - * @example Creating a red-black tree with a custom comparison function - * ```ts no-assert - * import { RedBlackTree, ascend } from "@std/data-structures"; - * - * const tree = new RedBlackTree<{ price: number, name: string }>( - * (a, b) => ascend(a.price, b.price) || ascend(a.name, b.name) - * ); - * ``` - * * @param compare A custom comparison function for the values. The default comparison function sorts by ascending order. */ constructor(compare: (a: T, b: T) => number = ascend) {