From af7372ba30f27825a4e01f1aeb2378f08e1450de Mon Sep 17 00:00:00 2001 From: Revone Date: Sun, 22 Oct 2023 00:00:22 +0800 Subject: [PATCH] [pkg] ready to publish v1.37.0 --- CHANGELOG.md | 3 ++- package-lock.json | 36 ++++++++++++++++++------------------ package.json | 10 +++++----- test/utils/big-o.ts | 9 +++++---- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b31a5de..0d60600 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,11 @@ 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.36.9](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) +## [v1.37.0](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) ### Changes +- [binary-tree, graph] Replace all code that uses Arrays as makeshift Q… [`#18`](https://github.com/zrwusa/data-structure-typed/pull/18) - 1. No need for dfsIterative; integrate it directly into the dfs metho… [`#17`](https://github.com/zrwusa/data-structure-typed/pull/17) - [heap] fibonacci heap implemented. [test] big O estimate. [project] n… [`#15`](https://github.com/zrwusa/data-structure-typed/pull/15) - [rbtree] implemented, but with bugs [`#13`](https://github.com/zrwusa/data-structure-typed/pull/13) diff --git a/package-lock.json b/package-lock.json index 34a1209..0d4a720 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "data-structure-typed", - "version": "1.36.9", + "version": "1.37.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "data-structure-typed", - "version": "1.36.9", + "version": "1.37.0", "license": "MIT", "devDependencies": { "@types/benchmark": "^2.1.3", @@ -15,17 +15,17 @@ "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "auto-changelog": "^2.4.0", - "avl-tree-typed": "^1.36.8", + "avl-tree-typed": "^1.36.9", "benchmark": "^2.1.4", - "binary-tree-typed": "^1.36.8", - "bst-typed": "^1.36.8", + "binary-tree-typed": "^1.36.9", + "bst-typed": "^1.36.9", "dependency-cruiser": "^14.1.0", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.28.1", - "heap-typed": "^1.36.8", + "heap-typed": "^1.36.9", "istanbul-badges-readme": "^1.8.5", "jest": "^29.7.0", "prettier": "^3.0.3", @@ -2396,9 +2396,9 @@ } }, "node_modules/avl-tree-typed": { - "version": "1.36.8", - "resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.36.8.tgz", - "integrity": "sha512-cdzKqEFMfCE9D54wqnKvNaFn5RQI4reRcKg1CHPN2a5PicJn6uXcoULGPX9b4TKI35PJNhZ+7Blq4Y+5olsUsw==", + "version": "1.36.9", + "resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.36.9.tgz", + "integrity": "sha512-JCcrzwqotdd62ojLQZR74kTcmlgn+Y0w+Ws2l58ZzStW8dWVZUY/KybRxVJnY1XT50DTYY6RzAf1UFgj52anvw==", "dev": true, "dependencies": { "data-structure-typed": "^1.36.8" @@ -2586,9 +2586,9 @@ } }, "node_modules/binary-tree-typed": { - "version": "1.36.8", - "resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.36.8.tgz", - "integrity": "sha512-Brh3DLTcm17ZmJoDNVWG3f6aeD448ANjv5EQi19ZrwPwMddlLRdvEn08lfdheq78lzw3x2rOU7GgFA4W+fbeFw==", + "version": "1.36.9", + "resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.36.9.tgz", + "integrity": "sha512-3YBodVs6gpGkgyY7vhDL+m20G/RyRFnu5Yqgf6xYvabwoChc8Yzv+UrxMqD7CVDt2o/WvvEuC/M7U5GYSNLY2A==", "dev": true, "dependencies": { "data-structure-typed": "^1.36.8" @@ -2670,9 +2670,9 @@ } }, "node_modules/bst-typed": { - "version": "1.36.8", - "resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.36.8.tgz", - "integrity": "sha512-bjWACK4u+qXIetBrOcs8GRLucxsshnxcP8FDnPXzDr2sl84aVITvt+yQ4hpuft7t3C3Z2X2PtTp2alSiE3gquw==", + "version": "1.36.9", + "resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.36.9.tgz", + "integrity": "sha512-FAQ6KiVuF6RCakPIgZwtZ/VdfKj2gL64rO/CN6DWP0jWYWoYvsqDW3pr83PvUhjNsxLQW5q92GT17wMOmjwDog==", "dev": true, "dependencies": { "data-structure-typed": "^1.36.8" @@ -4362,9 +4362,9 @@ } }, "node_modules/heap-typed": { - "version": "1.36.8", - "resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.36.8.tgz", - "integrity": "sha512-hk/W8DIgU8jTDdD2fbjVxnYUha30DCJrkt7LDnA0V1yWiMt1/YgJOToQVodMcPh3yN25dNQLGo8MVGnonlYhZQ==", + "version": "1.36.9", + "resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.36.9.tgz", + "integrity": "sha512-Dy7W2SooiSAc3+2Kcdb7/GvJXkguUc+hz2qLKvSbdisH6z4siOoNYoVmZJjSrc11udW1JpEINK+LqjOBlLAxiw==", "dev": true, "dependencies": { "data-structure-typed": "^1.36.8" diff --git a/package.json b/package.json index 61f1290..5b20ca9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-structure-typed", - "version": "1.36.9", + "version": "1.37.0", "description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.", "main": "dist/index.js", "module": "lib/index.js", @@ -58,17 +58,17 @@ "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "auto-changelog": "^2.4.0", - "avl-tree-typed": "^1.36.8", + "avl-tree-typed": "^1.36.9", "benchmark": "^2.1.4", - "binary-tree-typed": "^1.36.8", - "bst-typed": "^1.36.8", + "binary-tree-typed": "^1.36.9", + "bst-typed": "^1.36.9", "dependency-cruiser": "^14.1.0", "eslint": "^8.50.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.28.1", - "heap-typed": "^1.36.8", + "heap-typed": "^1.36.9", "istanbul-badges-readme": "^1.8.5", "jest": "^29.7.0", "prettier": "^3.0.3", diff --git a/test/utils/big-o.ts b/test/utils/big-o.ts index 9c40770..e9082a8 100644 --- a/test/utils/big-o.ts +++ b/test/utils/big-o.ts @@ -1,5 +1,6 @@ import {AnyFunction} from '../types'; +const isDebug = false; const orderReducedBy = 2; // reduction of bigO's order compared to the baseline bigO export const magnitude = { @@ -148,12 +149,12 @@ export function logBigOMetricsWrap(fn: F, args: Parameter methodLog.push([runTime, maxDataSize]); if (methodLog.length >= 20) { - console.log('triggered', methodName, methodLog); + isDebug && console.log('triggered', methodName, methodLog); const bigO = estimateBigO( methodLog.map(([runTime]) => runTime), methodLog.map(([runTime]) => runTime) ); - console.log(`Estimated Big O: ${bigO}`); + isDebug && console.log(`Estimated Big O: ${bigO}`); methodLogs.delete(methodName); } } @@ -182,12 +183,12 @@ export function logBigOMetrics(target: any, propertyKey: string, descriptor: Pro methodLog.push([runTime, maxDataSize]); if (methodLog.length >= 20) { - console.log('triggered', methodName, methodLog); + isDebug && console.log('triggered', methodName, methodLog); const bigO = estimateBigO( methodLog.map(([runTime]) => runTime), methodLog.map(([runTime]) => runTime) ); - console.log(`Estimated Big O: ${bigO}`); + isDebug && console.log(`Estimated Big O: ${bigO}`); methodLogs.delete(methodName); } }