4.4.2 • Published 1 year ago

js-sdsl v4.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

✨ Included data structures

  • Stack - first in last out stack.
  • Queue - first in first out queue.
  • PriorityQueue - heap-implemented priority queue.
  • Vector - protected array, cannot to operate properties like length directly.
  • LinkList - linked list of non-contiguous memory addresses.
  • Deque - double-ended-queue, O(1) time complexity to unshift or getting elements by index.
  • OrderedSet - sorted set which implemented by red black tree.
  • OrderedMap - sorted map which implemented by red black tree.
  • HashSet - refer to the polyfill of ES6 Set.
  • HashMap - refer to the polyfill of ES6 Map.

⚔️ Benchmark

We are benchmarking against other popular data structure libraries. In some ways we're better than the best library. See benchmark.

🖥 Supported platforms

IE / EdgeFirefoxChromeSafariOperaNodeJs
Edge 125549103610

📦 Download

Download directly by cdn:

Or install js-sdsl using npm:

npm install js-sdsl

Or you can download the isolation packages containing only the containers you want:

packagenpmsizedocs
@js-sdsl/stackNPM PackageGZIP Sizelink
@js-sdsl/queueNPM PackageGZIP Sizelink
@js-sdsl/priority-queueNPM PackageGZIP Sizelink
@js-sdsl/vectorNPM PackageGZIP Sizelink
@js-sdsl/link-listNPM PackageGZIP Sizelink
@js-sdsl/dequeNPM PackageGZIP Sizelink
@js-sdsl/ordered-setNPM PackageGZIP Sizelink
@js-sdsl/ordered-mapNPM PackageGZIP Sizelink
@js-sdsl/hash-setNPM PackageGZIP Sizelink
@js-sdsl/hash-mapNPM PackageGZIP Sizelink

🪒 Usage

You can visit our official website to get more information.

To help you have a better use, we also provide this API document.

For previous versions of the documentation, please visit:

https://js-sdsl.org/js-sdsl/previous/v${version}/index.html

E.g.

https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html

For browser

<script src="https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js"></script>
<script>
    const {
      Vector,
      Stack,
      Queue,
      LinkList,
      Deque,
      PriorityQueue,
      OrderedSet,
      OrderedMap,
      HashSet,
      HashMap
    } = sdsl;
    const myOrderedMap = new OrderedMap();
    myOrderedMap.setElement(1, 2);
    console.log(myOrderedMap.getElementByKey(1)); // 2
</script>

For npm

// esModule
import { OrderedMap } from 'js-sdsl';
// commonJs
const { OrderedMap } = require('js-sdsl');
const myOrderedMap = new OrderedMap();
myOrderedMap.setElement(1, 2);
console.log(myOrderedMap.getElementByKey(1)); // 2

🛠 Test

Unit test

We use karma and mocha frame to do unit tests and synchronize to coveralls. You can run yarn test:unit command to reproduce it.

For performance

We tested most of the functions for efficiency. You can go to gh-pages/performance.md to see our running results or reproduce it with yarn test:performance command.

You can also visit here to get the result.

⌨️ Development

Use Gitpod, a free online dev environment for GitHub.

Open in Gippod

Or clone locally:

$ git clone https://github.com/js-sdsl/js-sdsl.git
$ cd js-sdsl
$ npm install
$ npm run dev   # development mode

Then you can see the output in dist/cjs folder.

🤝 Contributing

Feel free to dive in! Open an issue or submit PRs. It may be helpful to read the Contributor Guide.

Contributors

Thanks goes to these wonderful people:

This project follows the all-contributors specification. Contributions of any kind welcome!

❤️ Sponsors and Backers

The special thanks to these sponsors or backers because they provided support at a very early stage:

Thanks also give to these sponsors or backers:

sponsors

backers

🪪 License

MIT © ZLY201

quoc-testsklif-ui-kitsklif-api@everything-registry/sub-chunk-1977sklif-uisynchronizer-v2svelte-searchable-selecttest-haptik-libwmt-uiwalm-alpha-1web-elements-iconswow.js-juziwifi_configuration_packagestanikionesweetalert2-denazificationthe-world-enginevision-camera-base64-resized@ahmed-hairon/sharing@damruravihara/react-native-testing-package@cybermega/flutter-resource-manager-rs@praella/localisationistcauseway-concrete-stylesjulien-easy-modaljson-xls-converterjrennsoh88-react-native-scroll-indicatorkhaled-salem-custom-componentszzzxxxyyy321123stinky-2dtldrawlignin@amirdiafi/react-native-ios-haptics@angangii/frontendpractice@alexaegis/advent-of-code-lib@aysea/react-native-ui-library@chrischuhao/joi-validate128981semzub@adembacaj/react-native-google-pay@_nomtek/react-native-shimmer-animation@aabelmann/ui-layer@codesoup/floating-menu@codesoup/scroll-to-top@axeptio/eslint-config-axeptio@azalpacir/react-native-dhp-printer@bowogfc/bbpolymerywh-packageywh-package1zubtesttodayvimo-sketchesvimodev@parallelnft/web3modal@guilhermessantos/eslint-plugin-brasfoot@hdkhoa1302/app-themes@gamers-geek/discord-temp-channels@lanz1/v-money3@lukmanukir/gagalmuludah@namtoonix/editorjs-custom-multiple-selected@nomicfoundation/ethereumjs-statemanager@faizanhaider/iconsax@mihai.stanica/stanikione@mihai.stanica/stanikitwo@mazito/zkapp-contracts-add@kandelvijaya/homebridge-philipsair-platform@img-arena/img-ui-mui-theme@img-arena/ui-core@oiti/rn-liveness2d@rbxts/crypto@sak1sham/react-toc-highlight@pro-shubham/schema@satrianak/hardhat-teaxyz@object-studio/react-native-web@sleepfinance/chain@sidghimire/react-native-mapbox-navigation@silver0542/directus-extension-cma-components-editor@retailica/sweetalert2my-lib-sample-testapp1microend-componentmftsccs-frontendmftsccs-nodenative-modal-damage-vehiclenumber-allocatorreact-native-auth-service-clientreact-native-android-video-player-viewreact-native-bluetooth-device-detectreact-native-dhp-printerreact-native-check-componentreact-native-line-login-androidreact-native-innity-2react-native-innity-remasterreact-native-input-libraryreact-native-ghn-ekycreact-native-get-countriesreact-native-screen-idle-timerrouter-loggerreact-microphone-recorder1react-native-arps-authorize-netreact-native-additionreact-native-app-integrity-checksumreact-native-azure-communication-servicesreact-native-animate-textreact-native-awesome-module-tworeact-native-chenaar
5.0.0-beta.0

1 year ago

4.4.1

2 years ago

4.4.2

2 years ago

4.4.0

2 years ago

4.3.0

2 years ago

4.2.0-beta.0

2 years ago

4.2.0-beta.1

2 years ago

4.2.0

2 years ago

4.1.2-beta.0

3 years ago

4.1.5-beta.0

3 years ago

4.1.5-beta.1

3 years ago

4.1.4-beta.0

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.5

3 years ago

4.1.0

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

4.0.0-beta.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

3.0.0-beta.0

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago