Skip to content

Commit

Permalink
release: 1.51.8
Browse files Browse the repository at this point in the history
  • Loading branch information
zrwusa committed Jan 25, 2024
1 parent 0013242 commit 3c26538
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 61 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)

## [v1.51.7](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)
## [v1.51.8](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)

## [v1.51.5](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...v1.51.5) (18 January 2024)

Expand Down
26 changes: 13 additions & 13 deletions README.md

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.51.7",
"version": "1.51.8",
"description": "Javascript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
Expand Down Expand Up @@ -66,11 +66,11 @@
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"auto-changelog": "^2.4.0",
"avl-tree-typed": "^1.51.6",
"avl-tree-typed": "^1.51.7",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.51.6",
"bst-typed": "^1.51.5",
"data-structure-typed": "^1.51.6",
"binary-tree-typed": "^1.51.7",
"bst-typed": "^1.51.7",
"data-structure-typed": "^1.51.7",
"dependency-cruiser": "^14.1.0",
"doctoc": "^2.2.1",
"eslint": "^8.50.0",
Expand All @@ -79,7 +79,7 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"fast-glob": "^3.3.1",
"heap-typed": "^1.51.5",
"heap-typed": "^1.51.7",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.7.0",
"js-sdsl": "^4.4.2",
Expand Down
8 changes: 4 additions & 4 deletions src/data-structures/binary-tree/binary-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class BinaryTree<
* `Partial<BinaryTreeOptions>`, which means that not all properties of `BinaryTreeOptions` are
* required.
*/
constructor(keysOrNodesOrEntries: Iterable<KeyOrNodeOrEntry<K, V, NODE>> = [], options?: BinaryTreeOptions<K>) {
constructor(keysOrNodesOrEntries: Iterable<KeyOrNodeOrEntry<K, V, NODE>> = [], options?: BinaryTreeOptions) {
super();
if (options) {
const { iterationType } = options;
Expand Down Expand Up @@ -209,7 +209,7 @@ export class BinaryTree<
* you can provide only a subset of the properties defined in the `BinaryTreeOptions` interface.
* @returns a new instance of a binary tree.
*/
createTree(options?: Partial<BinaryTreeOptions<K>>): TREE {
createTree(options?: Partial<BinaryTreeOptions>): TREE {
return new BinaryTree<K, V, NODE, TREE>([], { iterationType: this.iterationType, ...options }) as TREE;
}

Expand Down Expand Up @@ -1831,10 +1831,10 @@ export class BinaryTree<
console.log(`U for undefined
`);
if (opts.isShowNull)
console.log(`NODE for null
console.log(`N for null
`);
if (opts.isShowRedBlackNIL)
console.log(`S for Sentinel Node
console.log(`S for Sentinel Node(NIL)
`);

const display = (root: NODE | null | undefined): void => {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/binary-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IBinaryTree<
> {
createNode(key: K, value?: N['value']): N;

createTree(options?: Partial<BinaryTreeOptions<K>>): TREE;
createTree(options?: Partial<BinaryTreeOptions>): TREE;

add(keyOrNodeOrEntry: KeyOrNodeOrEntry<K, V, N>, value?: V, count?: number): boolean;

Expand Down
2 changes: 1 addition & 1 deletion src/types/data-structures/binary-tree/binary-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export type BinaryTreeNodeNested<K extends Comparable, V> = BinaryTreeNode<K, V,

export type BinaryTreeNested<K extends Comparable, V, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

export type BinaryTreeOptions<K> = {
export type BinaryTreeOptions = {
iterationType?: IterationType
}
2 changes: 1 addition & 1 deletion src/types/data-structures/binary-tree/bst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export type BSTNodeNested<K extends Comparable, V> = BSTNode<K, V, BSTNode<K, V,

export type BSTNested<K extends Comparable, V, N extends BSTNode<K, V, N>> = BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

export type BSTOptions<K> = BinaryTreeOptions<K> & {
export type BSTOptions<K> = BinaryTreeOptions & {
comparator?: Comparator<K>
}
2 changes: 1 addition & 1 deletion test/integration/all-in-one.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('AVL Tree Test from data-structure-typed', () => {
expect(subTreeSum).toBe(70);

let lesserSum = 0;
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
expect(lesserSum).toBe(45);

// node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/avl-tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('AVL Tree Test', () => {
expect(subTreeSum).toBe(70);

let lesserSum = 0;
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
expect(lesserSum).toBe(45);

// node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
Expand Down
4 changes: 2 additions & 2 deletions test/integration/bst.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Individual package BST operations test', () => {
expect(subTreeSum).toBe(70);

let lesserSum = 0;
bst.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
bst.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
expect(lesserSum).toBe(45);

expect(node15).toBeInstanceOf(BSTNode);
Expand Down Expand Up @@ -235,7 +235,7 @@ describe('Individual package BST operations test', () => {
expect(subTreeSum).toBe(70);

let lesserSum = 0;
objBST.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
objBST.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
expect(lesserSum).toBe(45);

expect(node15).toBeInstanceOf(BSTNode);
Expand Down
5 changes: 2 additions & 3 deletions test/performance/reportor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import * as Benchmark from 'benchmark';
import * as path from 'path';
import * as fs from 'fs';
import * as fastGlob from 'fast-glob';
import { Color, numberFix, render } from '../utils';
import { ConsoleColor, numberFix, render } from '../utils';
import { PerformanceTest } from './types';
import * as console from 'console';

const args = process.argv.slice(2);

const { GREEN, BOLD, END, YELLOW, GRAY, CYAN, BG_YELLOW } = Color;
const { GREEN, BOLD, END, YELLOW, GRAY, CYAN, BG_YELLOW } = ConsoleColor;

const getRelativePath = (file: string) => {
return path.relative(__dirname, file);
Expand Down
2 changes: 1 addition & 1 deletion test/utils/console.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const Color = {
export const ConsoleColor = {
END: '\x1b[0m',
BOLD: '\x1b[1m',
DIM: '\x1b[2m',
Expand Down

0 comments on commit 3c26538

Please sign in to comment.