Skip to content

Commit

Permalink
release: 1.50.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zrwusa committed Jan 14, 2024
1 parent 76df347 commit 46cdf2b
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 115 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.50.8](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
## [v1.50.9](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)

### Changes

Expand Down
124 changes: 61 additions & 63 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.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.50.8",
"version": "1.50.9",
"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 @@ -34,7 +34,7 @@
"format:test": "prettier --write 'test/**/*.{js,ts}'",
"format": "npm run format:src && npm run format:test",
"check:exist-latest": "sh scripts/check_exist_remotely.sh",
"ci": "env && git fetch --tags && npm run inspect && npm run lint && npm run build && npm run test:unit && npm run changelog",
"ci": "env && git fetch --tags && npm run update:subs && npm run inspect && npm run lint && npm run build && npm run test:unit && npm run changelog",
"update:subs": "npm i avl-tree-typed binary-tree-typed bst-typed heap-typed data-structure-typed --save-dev",
"install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multimap-typed trie-typed undirected-graph-typed queue-typed --save-dev",
"changelog": "auto-changelog",
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.50.7",
"avl-tree-typed": "^1.50.9",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.50.7",
"bst-typed": "^1.50.7",
"data-structure-typed": "^1.50.7",
"binary-tree-typed": "^1.50.9",
"bst-typed": "^1.50.9",
"data-structure-typed": "^1.50.9",
"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.50.7",
"heap-typed": "^1.50.9",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.7.0",
"js-sdsl": "^4.4.2",
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), CP.lt, 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), CP.lt, 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), CP.lt, 10);
objBST.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
expect(lesserSum).toBe(45);

expect(node15).toBeInstanceOf(BSTNode);
Expand Down
35 changes: 20 additions & 15 deletions test/performance/data-structures/binary-tree/avl-tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@ import * as Benchmark from 'benchmark';
import { getRandomIntArray, magnitude } from '../../../utils';

const suite = new Benchmark.Suite();
const avl = new AVLTree<number>();
const { TEN_THOUSAND } = magnitude;
const arr = getRandomIntArray(TEN_THOUSAND, 0, TEN_THOUSAND, true);
const avlTree = new AVLTree<number>();
const { HUNDRED_THOUSAND } = magnitude;
const randomArray = getRandomIntArray(HUNDRED_THOUSAND, 0, HUNDRED_THOUSAND - 1, true);

suite
.add(`${TEN_THOUSAND.toLocaleString()} add randomly`, () => {
avl.clear();
for (let i = 0; i < arr.length; i++) avl.add(arr[i]);
.add(`${HUNDRED_THOUSAND.toLocaleString()} add`, () => {
avlTree.clear();
for (let i = 0; i < randomArray.length; i++) avlTree.add(i);
})
.add(`${TEN_THOUSAND.toLocaleString()} get`, () => {
for (let i = 0; i < arr.length; i++) avl.get(arr[i]);
.add(`${HUNDRED_THOUSAND.toLocaleString()} get`, () => {
for (let i = 0; i < randomArray.length; i++) avlTree.get(randomArray[i]);
})
.add(`${TEN_THOUSAND.toLocaleString()} add & delete randomly`, () => {
avl.clear();
for (let i = 0; i < arr.length; i++) avl.add(arr[i]);
for (let i = 0; i < arr.length; i++) avl.delete(arr[i]);
.add(`${HUNDRED_THOUSAND.toLocaleString()} iterator`, () => {
const entries = [...avlTree];
return entries.length === HUNDRED_THOUSAND;
})
.add(`${TEN_THOUSAND.toLocaleString()} addMany`, () => {
avl.clear();
avl.addMany(arr);
.add(`${HUNDRED_THOUSAND.toLocaleString()} add & delete orderly`, () => {
avlTree.clear();
for (let i = 0; i < randomArray.length; i++) avlTree.add(i);
for (let i = 0; i < randomArray.length; i++) avlTree.delete(i);
})
.add(`${HUNDRED_THOUSAND.toLocaleString()} add & delete randomly`, () => {
avlTree.clear();
for (let i = 0; i < randomArray.length; i++) avlTree.add(randomArray[i]);
for (let i = 0; i < randomArray.length; i++) avlTree.delete(randomArray[i]);
});

export { suite };

0 comments on commit 46cdf2b

Please sign in to comment.