diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..b2fcb55b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,122 @@ +# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/ +version: 2 # use CircleCI 2.0 +jobs: # a collection of steps + build: # runs not using Workflows must have a `build` job as entry point + docker: # run the steps with Docker + - image: circleci/node:lts # ...with this image as the primary container; this is where all `steps` will run + steps: + - checkout + - run: + name: update-npm + command: 'sudo npm install -g npm@latest' + - run: + name: node version + command: node -v + - run: + name: NPM version + command: npm -v + + - restore_cache: # special step to restore the dependency cache + # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ + keys: + # Find a cache corresponding to this specific package-lock.json checksum + - npm-v1-{{ checksum "package-lock.json" }} + # Find the most recently generated cache used from any branch + - npm-v1- + - run: + name: npm install + command: npm install + + - save_cache: # special step to save the dependency cache + key: npm-v1-{{ checksum "package-lock.json" }} + paths: + - ./node_modules + + - run: # run tests + name: run tests + command: npm run ci + + - store_artifacts: # special step to save test results as as artifact + # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ + path: test-results.xml + prefix: tests + - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ + path: coverage + prefix: coverage + - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ + path: test-results.xml + + - run: + name: release + command: npm run semantic-release || true + + docs: + docker: + - image: circleci/ruby:2.7.1-buster-node + environment: + NOKOGIRI_USE_SYSTEM_LIBRARIES: true + steps: + - add_ssh_keys: + fingerprints: + - "b5:40:36:ee:3c:52:25:dd:c7:41:f3:10:d1:ce:f9:33" + - checkout + - run: + name: checkout repo and submodules + command: git submodule update --init --recursive + - run: + name: bundler version + command: bundle -v + - run: + name: ruby version + command: ruby -v + - run: + name: node version + command: node -v + - run: + name: NPM version + command: npm -v + + - run: sudo apt-get update + + - run: + name: graphviz for dot diagrams + command: sudo apt-get -qq -y install graphviz + + - run: + name: Bundle Install.pre - needed for mathematical -> 'asciidoctor-mathematical' gem + command: sudo apt-get -qq -y install cmake bison flex libffi-dev libxml2-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev + + - run: + name: Bundle Install.pre - install GraphicsMagick for 'prawn-gmagick' gem + command: sudo apt-get -qq -y install graphicsmagick-imagemagick-compat graphicsmagick-libmagick-dev-compat + + # Restore bundle cache + - restore_cache: + keys: + - gemfile-v1-{{ checksum "book/config/Gemfile.lock" }} + - gemfile-v1- + + - run: + name: Bundle Install + command: cd book/config && bundle check --path vendor/bundle || ( bundle install --path vendor/bundle ) + + # Store bundle cache + - save_cache: + key: gemfile-v1-{{ checksum "book/config/Gemfile.lock" }} + paths: + - book/config/vendor/bundle + + - run: + name: generate PDF + command: cd book/config && make VERSION="$(npx -c 'echo "$npm_package_version"')" + + - store_artifacts: + path: book/dist + destination: book + +workflows: + version: 2 + build_and_docs: + jobs: + - build + - docs diff --git a/.editorconfig b/.editorconfig index b2eb5921..de3acdb2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,7 @@ root = true [*] end_of_line = lf insert_final_newline = true +trim_trailing_whitespace = true # Matches multiple files with brace expansion notation # Set default charset diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..38bb7054 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +/runtimes/** +src/data-structures/maps/hash-maps/hashing.js +src/data-structures/maps/hash-maps/*-test.js +src/data-structures/maps/hash-maps/hash-map-*.js +src/data-structures/linked-lists/linked-list-*.js +src/data-structures/custom/lru-cache-*.js diff --git a/.eslintrc.js b/.eslintrc.js index 0c7f7af4..404d8807 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,23 +1,35 @@ module.exports = { - "extends": "airbnb-base", - "env": { - "jest": true + extends: 'airbnb-base', + env: { + jest: true, }, + plugins: ['jest'], + globals: { + BigInt: true, + }, + + // check package.json for files to include + // files: ['src/**/*.js', 'book/interview-questions/*.js'], + rules: { // https://github.com/airbnb/javascript/issues/1089 // https://stackoverflow.com/a/35637900/684957 // allow to add properties to arguments - "no-param-reassign": [2, { "props": false }], + 'no-param-reassign': [2, { props: false }], // https://eslint.org/docs/rules/no-plusplus // allows unary operators ++ and -- in the afterthought (final expression) of a for loop. - "no-plusplus": [2, { "allowForLoopAfterthoughts": true }], + 'no-plusplus': [0, { allowForLoopAfterthoughts: true }], + 'no-continue': [0], // Allow for..of - "no-restricted-syntax": [0, "ForOfStatement"], + 'no-restricted-syntax': [0, 'ForOfStatement'], + + // jest plugin + // 'jest/no-disabled-tests': 'warn', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'warn', + 'jest/valid-expect': 'warn', }, - globals: { - BigInt: true, - } }; diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..c685c664 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: amejiarosario # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: amejiarosario # Replace with a single Patreon username +custom: https://adrianmejia.com/support/ # Replace with a single custom sponsorship URL diff --git a/.gitignore b/.gitignore index 47f69d6f..9675ebf8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ coverage dist _book .DS_Store +.asciidoctor/ # https://raw.githubusercontent.com/mraible/infoq-mini-book/master/.gitignore ###################### @@ -71,7 +72,6 @@ local.properties # Ruby ###################### /.bundle/ -/Gemfile.lock ###################### # Package Files @@ -86,6 +86,7 @@ local.properties ###################### # Windows image file caches Thumbs.db +*Zone.Identifier # Folder config file Desktop.ini @@ -135,14 +136,13 @@ Desktop.ini # ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/fonts . # ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/images . ###################### -Gemfile -Gemfile.lock -Makefile -_conf -_resources -extensions -fonts -images +# Gemfile +# Gemfile.lock +# Makefile +# _conf +# _resources +# extensions +# fonts ###################### diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..17750b22 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "book/config"] + path = book/config + url = git@github.com:amejiarosario/dsa.js-private.git diff --git a/.node-version b/.node-version index c4d592e1..66df3b7a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -10.12.0 +12.16.1 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..c4dcc94b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "peacock.color": "#f9e64f", + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#fbed80", + "activityBar.activeBorder": "#06b9a5", + "activityBar.background": "#fbed80", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#06b9a5", + "activityBarBadge.foreground": "#15202b", + "statusBar.background": "#f9e64f", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#f7df1e", + "titleBar.activeBackground": "#f9e64f", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#f9e64f99", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.remoteColor": "#f9e64f" +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..4e021d32 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,453 @@ +## [2.7.6](https://github.com/amejiarosario/dsa.js/compare/2.7.5...2.7.6) (2021-11-30) + + +### Bug Fixes + +* **graph:** minor typo in bfs code documentation ([ccfcfe6](https://github.com/amejiarosario/dsa.js/commit/ccfcfe6f039ce3f6e289d368fbdbf67e227c168c)), closes [#110](https://github.com/amejiarosario/dsa.js/issues/110) + +## [2.7.5](https://github.com/amejiarosario/dsa.js/compare/2.7.4...2.7.5) (2021-05-24) + + +### Bug Fixes + +* **bst:** on duplicates values the same node is returned ([d350da8](https://github.com/amejiarosario/dsa.js/commit/d350da8bd2d7cf5c8f4425e863babf19cbdcbdf4)), closes [#99](https://github.com/amejiarosario/dsa.js/issues/99) + +## [2.7.4](https://github.com/amejiarosario/dsa.js/compare/2.7.3...2.7.4) (2021-01-09) + + +### Bug Fixes + +* **bst:** some typos on the code ([6b9a4e8](https://github.com/amejiarosario/dsa.js/commit/6b9a4e8c00c2082ed7d083b58f7d462e340725fe)) + +## [2.7.3](https://github.com/amejiarosario/dsa.js/compare/2.7.2...2.7.3) (2020-12-22) + + +### Bug Fixes + +* **book/bst:** better wording ([1d75301](https://github.com/amejiarosario/dsa.js/commit/1d7530199940b926467ad0dcbc3b7dbe76b77820)) +* **book/graph:** add comments for runtimes using hashset implementations ([c7c7947](https://github.com/amejiarosario/dsa.js/commit/c7c7947da33cb61a794e538dff55951318edc341)) +* **book/hashmap:** exercise example and add tests ([c137930](https://github.com/amejiarosario/dsa.js/commit/c137930a8750c0aac95bbbae931886e068371d92)) + +## [2.7.2](https://github.com/amejiarosario/dsa.js/compare/2.7.1...2.7.2) (2020-12-17) + + +### Bug Fixes + +* **book:** Rename fibonacci-dynamic-programming ([ded0a70](https://github.com/amejiarosario/dsa.js/commit/ded0a701815ce4647394e2f5e217c0d88142a92c)) + +## [2.7.1](https://github.com/amejiarosario/dsa.js/compare/2.7.0...2.7.1) (2020-12-02) + + +### Bug Fixes + +* **book:** update company names ([38a4178](https://github.com/amejiarosario/dsa.js/commit/38a4178e69e698a1b3c0d4452f0cfd58aed5290d)) + +# [2.7.0](https://github.com/amejiarosario/dsa.js/compare/2.6.0...2.7.0) (2020-10-30) + + +### Bug Fixes + +* **book/set:** split Set chapter into Hash Set and Tree Set for better ([c1cf57a](https://github.com/amejiarosario/dsa.js/commit/c1cf57a31fc7a698665c82c8fbd2fde7fb825078)) + + +### Features + +* **book:** show companies asked questions ([b3167f9](https://github.com/amejiarosario/dsa.js/commit/b3167f9c694c5e6719bf1d01804aeec60b41e57f)) +* **book/linkedlist:** add applications ([2b96f00](https://github.com/amejiarosario/dsa.js/commit/2b96f0086632d9ddcbb7e8f76a061a46f90a65a0)) + +# [2.6.0](https://github.com/amejiarosario/dsa.js/compare/2.5.1...2.6.0) (2020-10-28) + + +### Bug Fixes + +* **test:** refactor tests ([571834a](https://github.com/amejiarosario/dsa.js/commit/571834a848d3b4c7d0dd8a94957b73724f3756ac)) + + +### Features + +* **book:** add chapter numbers ([0f13f90](https://github.com/amejiarosario/dsa.js/commit/0f13f907141d0ad9bb439d131aca6d1d882421ee)) +* **book/linkedlist:** linked lists techniques and common patterns ([8cd126d](https://github.com/amejiarosario/dsa.js/commit/8cd126d71a31473fefdbf0f0a9780cd7b128bcd6)) + +## [2.5.1](https://github.com/amejiarosario/dsa.js/compare/2.5.0...2.5.1) (2020-10-23) + + +### Bug Fixes + +* **linkedlist:** refactored methods and improve book images and ([ba110e2](https://github.com/amejiarosario/dsa.js/commit/ba110e26b2103265bb78809618c7e29c185acd70)) +* **linkedlist:** rename indexOf to getIndex to make it clearer ([fcf3db6](https://github.com/amejiarosario/dsa.js/commit/fcf3db6ade12a7ed88a5b7756945a8b090ac63b9)) + +# [2.5.0](https://github.com/amejiarosario/dsa.js/compare/2.4.0...2.5.0) (2020-10-22) + + +### Features + +* **book/hashmap:** add code examples and patterns ([f7b8d59](https://github.com/amejiarosario/dsa.js/commit/f7b8d59ac8cbddacc34cac6a2f6e0a58419813fd)) + +# [2.4.0](https://github.com/amejiarosario/dsa.js/compare/2.3.0...2.4.0) (2020-10-19) + + +### Bug Fixes + +* **book/array:** improve examples and grammar ([04836cd](https://github.com/amejiarosario/dsa.js/commit/04836cd0cec3afb196d11704a45933e325816c20)) + + +### Features + +* **book/array:** add array patterns for solving problems ([8c7b7be](https://github.com/amejiarosario/dsa.js/commit/8c7b7be8fe24ec1df66846b05fbc2ef5daeb6c7e)) +* **book/array:** sliding window pattern ([8fa2746](https://github.com/amejiarosario/dsa.js/commit/8fa2746f5c917b0f5a88289d854166210925f9c7)) + +# [2.3.0](https://github.com/amejiarosario/dsa.js/compare/2.2.1...2.3.0) (2020-10-03) + + +### Features + +* **treeMap:** get last entry (highest value) ([249de5d](https://github.com/amejiarosario/dsa.js/commit/249de5d4769549e9f05562bb6dad50d4e0384524)) + +## [2.2.1](https://github.com/amejiarosario/dsa.js/compare/2.2.0...2.2.1) (2020-10-02) + + +### Bug Fixes + +* **book:** add introduction ([4505eb6](https://github.com/amejiarosario/dsa.js/commit/4505eb64a63b282ca9685b3b2cabb657149d9fe7)) + +# [2.2.0](https://github.com/amejiarosario/dsa.js/compare/2.1.0...2.2.0) (2020-09-29) + + +### Features + +* **book/big-o:** add new chapter on how to determine big o from code. ([68c73d4](https://github.com/amejiarosario/dsa.js/commit/68c73d4c3bb5fb1ec637d81b42a2f8dbfc4f0008)) + +# [2.1.0](https://github.com/amejiarosario/dsa.js/compare/2.0.0...2.1.0) (2020-09-11) + + +### Features + +* **book/sorting:** add questions and solutions ([fdb8bd8](https://github.com/amejiarosario/dsa.js/commit/fdb8bd8af644ddeaa07ce62773e9be96fd6b2404)) + +# [2.0.0](https://github.com/amejiarosario/dsa.js/compare/1.18.0...2.0.0) (2020-09-08) + + +### Features + +* **book/pq:** add exercise with pq and dijkstra ([3a2a24f](https://github.com/amejiarosario/dsa.js/commit/3a2a24ffae2af5e5e348c237195f7a39717ae617)) +* **heap:** add error handling for heaps ([827177f](https://github.com/amejiarosario/dsa.js/commit/827177f6023f639db0c2cc267dceb0a27746038a)) +* **pq:** improves docs and usability of priority queues ([edf8808](https://github.com/amejiarosario/dsa.js/commit/edf8808970d57aaf397958d2cab1a6cc2e029d26)) + + +### BREAKING CHANGES + +* **heap:** size is now an attribute rather than a method. Similar to the built-in Map.size and Set.size + +# [1.18.0](https://github.com/amejiarosario/dsa.js/compare/1.17.0...1.18.0) (2020-09-07) + + +### Features + +* **book/graph:** add schedule exercise and solution ([6a83cf8](https://github.com/amejiarosario/dsa.js/commit/6a83cf8a5d454b26e3048aa4ca73e44eafca0ed3)) + +# [1.17.0](https://github.com/amejiarosario/dsa.js/compare/1.16.0...1.17.0) (2020-09-04) + + +### Features + +* **book/set:** add questions and solutions ([f40dc63](https://github.com/amejiarosario/dsa.js/commit/f40dc6314a14e1750146a19163b3b70c30f09d70)) + +# [1.16.0](https://github.com/amejiarosario/dsa.js/compare/1.15.0...1.16.0) (2020-09-03) + + +### Features + +* **book/hashmap:** add exercises and solutions ([d18186b](https://github.com/amejiarosario/dsa.js/commit/d18186b61c260e3ae2cc1267cadd16c8cb453e00)) + +# [1.15.0](https://github.com/amejiarosario/dsa.js/compare/1.14.0...1.15.0) (2020-09-02) + + +### Bug Fixes + +* **book/solutions:** fix missing solutions ([464417e](https://github.com/amejiarosario/dsa.js/commit/464417e37ccde00d56d8ebb9c0d0ddc9e510e368)) + + +### Features + +* **BinaryTreeNode:** add BinaryTreeNode.from ([bcb4c28](https://github.com/amejiarosario/dsa.js/commit/bcb4c28089a96248ab9d623c25e1719e030caedc)) +* **book/binary-tree:** add right side view exercise and solution ([28346a4](https://github.com/amejiarosario/dsa.js/commit/28346a448e7f1be640751098b4a954ac04dd0aad)) +* **book/bt:** add binary tree diameter problem ([068dd9c](https://github.com/amejiarosario/dsa.js/commit/068dd9cc66e5a3050cc44d4cd3a05eb15f8c00d1)) + +# [1.14.0](https://github.com/amejiarosario/dsa.js/compare/1.13.0...1.14.0) (2020-08-31) + + +### Features + +* **book/questions:** add examples ([c1a8f8e](https://github.com/amejiarosario/dsa.js/commit/c1a8f8ec53f6c4c1302001dba6d913c81156fd98)) +* **book/questions:** add where the interview questions have been seen ([1f01baf](https://github.com/amejiarosario/dsa.js/commit/1f01bafdb55dcd82f6b88bdf1252c5aabb39277a)) +* **book/queue:** add recent counter questions and solution ([77d4596](https://github.com/amejiarosario/dsa.js/commit/77d459642ca61f729e698c892928665e76532701)) +* **book/queue:** add solution for queue question ([9a88766](https://github.com/amejiarosario/dsa.js/commit/9a887660bd21e7dbda0d3e87af704b4e41874093)) +* **queue:** add front, back and peek methods ([04aa9db](https://github.com/amejiarosario/dsa.js/commit/04aa9db26659058c09debe985f94845933a2089d)) + +# [1.13.0](https://github.com/amejiarosario/dsa.js/compare/1.12.0...1.13.0) (2020-08-26) + + +### Features + +* **book/exercises:** interview q&a for linked lists and stacks ([3bb86fd](https://github.com/amejiarosario/dsa.js/commit/3bb86fd544f543906b5723aab1f26d5a75f13950)) + +# [1.12.0](https://github.com/amejiarosario/dsa.js/compare/1.11.0...1.12.0) (2020-08-26) + + +### Features + +* **book/exercises:** interview q&a for linked lists and stacks ([#69](https://github.com/amejiarosario/dsa.js/issues/69)) ([ca4bf45](https://github.com/amejiarosario/dsa.js/commit/ca4bf45369ef772f4861e7619d3ea74ddc41cde4)) + + +### Reverts + +* Revert "(book/exercises): interview q&a for linked lists and stacks (#69)" (#70) ([06bd3f6](https://github.com/amejiarosario/dsa.js/commit/06bd3f6a8542b111e4c9e3b5d41050094b153112)), closes [#69](https://github.com/amejiarosario/dsa.js/issues/69) [#70](https://github.com/amejiarosario/dsa.js/issues/70) + +# [1.11.0](https://github.com/amejiarosario/dsa.js/compare/1.10.0...1.11.0) (2020-08-22) + + +### Bug Fixes + +* **book:** multiple broken links and bump epub version ([57960e2](https://github.com/amejiarosario/dsa.js/commit/57960e2c4f483e779e8344e07406ce7d67d4d9b8)), closes [#60](https://github.com/amejiarosario/dsa.js/issues/60) +* **book:** workaround for c++ issue in asciidoc ([dbdef21](https://github.com/amejiarosario/dsa.js/commit/dbdef2141ac1449c649cc76790d7990374e78808)) + + +### Features + +* **book:** add appendix D with interview question solutions ([ca119f2](https://github.com/amejiarosario/dsa.js/commit/ca119f2b2fe5e4392a0b13278b5a6ba9e907952c)) +* **book:array:** add solutions for interview questions ([b5a00dd](https://github.com/amejiarosario/dsa.js/commit/b5a00dded45a1f4eeab3bbbdd68ccbcbf02419d3)) +* **book/array:** add max subarray questions and solution ([5935b95](https://github.com/amejiarosario/dsa.js/commit/5935b95ea761402b296e5a4fbd6e3643714bcaf9)) +* **book/array:** add stock questions and solution ([6ab8bc4](https://github.com/amejiarosario/dsa.js/commit/6ab8bc4449323b059888edf84d66c76c9e812f4e)) + +# [1.10.0](https://github.com/amejiarosario/dsa.js/compare/1.9.0...1.10.0) (2020-07-28) + + +### Features + +* **book/arrays:** add exercises ([bcaf819](https://github.com/amejiarosario/dsa.js/commit/bcaf81919cb889c1209c6d1e577b037047714c05)) + +# [1.9.0](https://github.com/amejiarosario/dsa.js/compare/1.8.3...1.9.0) (2020-06-30) + + +### Features + +* **heap:** remove by index ([6af937f](https://github.com/amejiarosario/dsa.js/commit/6af937fb380ffcd26558193c1626bdb84b2abe17)) +* **linkedList:** takes iterables in the constructor ([1fa875f](https://github.com/amejiarosario/dsa.js/commit/1fa875fd772eb4a45dd9690bea593b513687caca)) + +## [1.8.3](https://github.com/amejiarosario/dsa.js/compare/1.8.2...1.8.3) (2020-05-24) + + +### Bug Fixes + +* **book/maps:** update space complexity ([0be0176](https://github.com/amejiarosario/dsa.js/commit/0be0176efc121c5608c1a2df25280d6d9c08e6f3)) + +## [1.8.2](https://github.com/amejiarosario/dsa.js/compare/1.8.1...1.8.2) (2020-05-24) + + +### Bug Fixes + +* **book/hashset:** update hashset space complexity ([0319b29](https://github.com/amejiarosario/dsa.js/commit/0319b29e92a630c5f14d5e3208b72fe536b38f43)) + +## [1.8.1](https://github.com/amejiarosario/dsa.js/compare/1.8.0...1.8.1) (2020-05-24) + + +### Bug Fixes + +* **book/maps:** update time/space complexity values ([3c4ef75](https://github.com/amejiarosario/dsa.js/commit/3c4ef7555c400828fb89339184294feb7169b215)) + +# [1.8.0](https://github.com/amejiarosario/dsa.js/compare/1.7.1...1.8.0) (2020-05-23) + + +### Bug Fixes + +* **book/map:** fix typo on maps space complexity ([2f24f57](https://github.com/amejiarosario/dsa.js/commit/2f24f57f989bb97f198bb32f6daa477d6075dc31)) +* **hashmap:** improve methods documentation ([f6b47b5](https://github.com/amejiarosario/dsa.js/commit/f6b47b5a6c53126bebbad72ac92da1a594042232)) + + +### Features + +* **maps:** implement clear method for hashMap and treeMap ([924c9a7](https://github.com/amejiarosario/dsa.js/commit/924c9a76db91f7df44f7cb38caba3aa9c3f0497f)) + +## [1.7.1](https://github.com/amejiarosario/dsa.js/compare/1.7.0...1.7.1) (2020-05-20) + + +### Bug Fixes + +* **hashmap:** fix TextEncoder reference ([e13ff88](https://github.com/amejiarosario/dsa.js/commit/e13ff88d7f8f9b7f38844befedc001bc1a4b243f)) + +# [1.7.0](https://github.com/amejiarosario/dsa.js/compare/1.6.0...1.7.0) (2020-05-16) + + +### Features + +* **heap:** add min/max/median-heaps ([202ca9f](https://github.com/amejiarosario/dsa.js/commit/202ca9f989ddba433b4f591e27bc094640cbbadf)) + +# [1.6.0](https://github.com/amejiarosario/dsa.js/compare/1.5.0...1.6.0) (2020-05-08) + +# [1.5.0](https://github.com/amejiarosario/dsa.js/compare/1.4.0...1.5.0) (2020-03-30) + + +### Features + +* **linkedList:** remove by node ([eac045a](https://github.com/amejiarosario/dsa.js/commit/eac045a6bedd0223a2e8b12225f87c428e6fb66f)) +* **lru-cache:** add new implementations ([3e787c6](https://github.com/amejiarosario/dsa.js/commit/3e787c6f9ba9c094272be5ac05b997ce44a359d3)) +* **trie:** remove method ([16005f3](https://github.com/amejiarosario/dsa.js/commit/16005f3bf39597759918e34b39d27eb25a5755e7)) + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) + +## [1.3.9] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(book): fix table typos [commit](https://github.com/amejiarosario/dsa.js/commit/bc51a7a0c97aea9dea1afa5f8af22c0bed1382d3) + +## [1.3.8] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(book): fix typo, array pop, and BST images [commit](https://github.com/amejiarosario/dsa.js/commit/ac9858348943f9678d116c8076bfa3a3c5362741) + +## [1.3.7] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(avl-tree): balance was not working properly [commit](https://github.com/amejiarosario/dsa.js/commit/98e2c037f05caf37731da1dc50dd8867a1804c0e) + +## [1.3.6] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- update deps [commit](https://github.com/amejiarosario/dsa.js/commit/d8ce2f5b1a3bfeb861928d6c99d7624cd9ac144a) +- style: fix eslint issue [commit](https://github.com/amejiarosario/dsa.js/commit/72e3d68e09bb9c7dd3fabf5cbeba1ae5571fc686) + +## [1.3.5] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(tree-rotations): prevent losing nodes [commit](https://github.com/amejiarosario/dsa.js/commit/1fa93415a6e14acc24e90443b2e9bdf053c4c983) + +## [1.3.4] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(queue): runtime error [commit](https://github.com/amejiarosario/dsa.js/commit/fd3ab480f2bb7cc2b7ce45da4e6a41831eafb7bf) +- fix(book): remove lorem ipsum [commit](https://github.com/amejiarosario/dsa.js/commit/6a06e3b75915a72ef0dd5ee9d37dcf434c4c8e18) +- docs(book): improve grammar + +## [1.2.3] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(linkedlist): removeFirst's last reference [commit](https://github.com/amejiarosario/dsa.js/commit/d4f9a71f6a22971ad8edcfd982d6b113f627d108) + +## [1.2.2] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- Optimize NPM package + +## [1.2.1] + +### Breaking Changes (major) + +### New Features (minor) + +### Bug Fixes (patch) +- fix(linked-list): insert in the middle bug [commit](https://github.com/amejiarosario/dsa.js/commit/f8bd4fd8fa6c8dcb0d26f54a6ed7d80e5443d65b) +- Various docs fixes. + +## [1.2.0] - 2019-04-04 + +### Breaking changes (major) + +### New Features (minor) + +- Added Eslint and Travis ci + +### Fixes (patch) + +- Readme improvements +- Badges for npm versions and build status + +## [1.1.0] - 2019-03-29 + +### Added + +- README.md added because NPM packages doesn't read README.adoc +- Public API to use the package `dsa.js` +- This changelog + +### Changed + +- Updated dependencies (removed lodash since is not needed) + +### Removed + +- + +## [1.0.0] - 2019-03-29 + +### Added + +- Started the project +- Book released +- npm package published + +### Changed + +- + +### Removed + +- + +[Unreleased]: https://github.com/amejiarosario/dsa.js/compare/1.3.9...HEAD +[1.3.9]: https://github.com/amejiarosario/dsa.js/compare/1.3.8...1.3.9 +[1.3.7]: https://github.com/amejiarosario/dsa.js/compare/1.3.7...1.3.8 +[1.3.6]: https://github.com/amejiarosario/dsa.js/compare/1.3.6...1.3.7 +[1.3.6]: https://github.com/amejiarosario/dsa.js/compare/1.3.5...1.3.6 +[1.3.5]: https://github.com/amejiarosario/dsa.js/compare/1.3.4...1.3.5 +[1.3.4]: https://github.com/amejiarosario/dsa.js/compare/1.2.3...1.3.4 +[1.2.2]: https://github.com/amejiarosario/dsa.js/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/amejiarosario/dsa.js/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/amejiarosario/dsa.js/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/amejiarosario/dsa.js/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/amejiarosario/dsa.js/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/amejiarosario/dsa.js/releases/tag/1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..43e79136 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,189 @@ +# Contributing + +We encourage any form of contribution, whether that will be issues, comments, or pull requests. If you are willing to submit a PR, there are a few things we would appreciate that you do to keep the codebase clean: + +* **Write tests (if applicable).** We try as close to 100% code coverage as possible on this repo, so any new code that gets written should have accompanying tests. +* **Follow the linter.** We use our [ESLint configuration with Airbnb JavaScript Styleguide](https://github.com/airbnb/javascript), and we run `npm run lint` in our Travis builds. +* **Ask questions if you aren't sure.** If you have any questions while implementing a fix or feature, feel free to create an issue and ask us. We're happy to help! + +## Submission Guidelines + +### Submitting an Issue + +Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists, and the discussion might inform you of workarounds readily available. + +### Submitting a Pull Request (PR) +Before you submit your Pull Request (PR), consider the following guidelines: + +1. Search [GitHub](https://github.com/amejiarosario/dsa.js/pulls) for an open or closed PR + that relates to your submission. You don't want to duplicate effort. +1. Be sure that an issue describes the problem you're fixing or documents the design for the feature you'd like to add. + Discussing the design upfront helps to ensure that we're ready to accept your work. +1. Fork the `amejiarosario/dsa.js` repo. +1. Make your changes in a new git branch: + + ```shell + git checkout -b my-fix-branch master + ``` + +1. Create your patch, **including appropriate test cases**. +1. Run the full test suite, and ensure that all tests pass. +1. Commit your changes using a descriptive commit message that follows our + [commit message conventions](#commit). Adherence to these conventions is necessary because release notes are automatically generated from these messages. + + ```shell + git commit -a + ``` + + Note: the optional commit `-a` command-line option will automatically "add" and "rm" edited files. + +1. Push your branch to GitHub: + + ```shell + git push origin my-fix-branch + ``` + +1. In GitHub, send a pull request to `dsa.js:master`. +* If we suggest changes then: + * Make the required updates. + * Re-run the test suites to ensure tests are still passing. + * Rebase your branch and force push to your GitHub repository (this will update your Pull Request): + + ```shell + git rebase master -i + git push -f + ``` + +That's it! Thank you for your contribution! + +#### After your pull request is merged + +After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository: + +* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: + + ```shell + git push origin --delete my-fix-branch + ``` + +* Check out the master branch: + + ```shell + git checkout master -f + ``` + +* Delete the local branch: + + ```shell + git branch -D my-fix-branch + ``` + +* Update your master with the latest upstream version: + + ```shell + git pull --ff upstream master + ``` + +## Commit Message Guidelines + +We have some guidelines on how our git commit messages can be formatted. These rules lead to more +readable messages that are easy to follow when looking through the project history. But also, +we use the git commit messages to **generate the change log**. + +### Commit Message Format +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject**: + +``` +(): + + + +