CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
README.md271 linesDownload Raw Back to ordered-map
1<p align="center">2  <a href="https://js-sdsl.org/" target="_blank" rel="noopener noreferrer">3    <img src="https://js-sdsl.org/assets/image/logo/logo-removebg.png" alt="js-sdsl logo" width="120" />4  </a>5</p>6 7<h3><p align="center">A javascript standard data structure library which benchmark against C++ STL</p></h3>8 9<p align="center">10  <a href="https://www.npmjs.com/package/js-sdsl"><img src="https://img.shields.io/npm/v/js-sdsl.svg" alt="NPM Version" /></a>11  <a href="https://github.com/js-sdsl/js-sdsl/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/js-sdsl/js-sdsl/build.yml" alt="Build Status" /></a>12  <a href='https://coveralls.io/github/js-sdsl/js-sdsl?branch=main'><img src='https://coveralls.io/repos/github/js-sdsl/js-sdsl/badge.svg?branch=main' alt='Coverage Status' /></a>13  <a href="https://github.com/js-sdsl/js-sdsl"><img src="https://img.shields.io/github/stars/js-sdsl/js-sdsl.svg" alt="GITHUB Star" /></a>14  <a href="https://npmcharts.com/compare/js-sdsl?minimal=true"><img src="https://img.shields.io/npm/dm/js-sdsl.svg" alt="NPM Downloads" /></a>15  <a href="https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js"><img src="https://img.badgesize.io/https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js?compression=gzip&style=flat-square/" alt="Gzip Size"></a>16  <a href="https://openbase.com/js/js-sdsl?utm_source=embedded&amp;utm_medium=badge&amp;utm_campaign=rate-badge"><img src="https://badges.openbase.com/js/rating/js-sdsl.svg?token=fh3LMNOV+JSWykSjtg1rA8kouSYkJoIDzGbvaByq5X0=" alt="Rate this package"/></a>17  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/npm/l/js-sdsl.svg" alt="MIT-license" /></a>18  <a href="https://github.com/js-sdsl/js-sdsl/"><img src="https://img.shields.io/github/languages/top/js-sdsl/js-sdsl.svg" alt="GITHUB-language" /></a>19</p>20 21<p align="center">English | <a href="https://github.com/js-sdsl/js-sdsl/blob/main/README.zh-CN.md">简体中文</a></p>22 23## ✨ Included data structures24 25- **Stack** - first in last out stack.26- **Queue** - first in first out queue.27- **PriorityQueue** - heap-implemented priority queue.28- **Vector** - protected array, cannot to operate properties like `length` directly.29- **LinkList** - linked list of non-contiguous memory addresses.30- **Deque** - double-ended-queue, O(1) time complexity to `unshift` or getting elements by index.31- **OrderedSet** - sorted set which implemented by red black tree.32- **OrderedMap** - sorted map which implemented by red black tree.33- **HashSet** - refer to the [polyfill of ES6 Set](https://github.com/rousan/collections-es6).34- **HashMap** - refer to the [polyfill of ES6 Map](https://github.com/rousan/collections-es6).35 36## ⚔️ Benchmark37 38We are benchmarking against other popular data structure libraries. In some ways we're better than the best library. See [benchmark](https://js-sdsl.org/#/test/benchmark-analyze).39 40## 🖥 Supported platforms41 42| ![][Edge-Icon]<br/>IE / Edge | ![][Firefox-Icon]<br/>Firefox | ![][Chrome-Icon]<br/>Chrome | ![][Safari-Icon]<br/>Safari | ![][Opera-Icon]<br/>Opera | ![][NodeJs-Icon]<br/>NodeJs |43|:----------------------------:|:-----------------------------:|:---------------------------:|:---------------------------:|:-------------------------:|:---------------------------:|44|           Edge 12            |              36               |             49              |             10              |            36             |             10              |45 46## 📦 Download47 48Download directly by cdn:49 50- [js-sdsl.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.js) (for development)51- [js-sdsl.min.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js) (for production)52 53Or install js-sdsl using npm:54 55```bash56npm install js-sdsl57```58 59Or you can download the isolation packages containing only the containers you want:60 61| package                                           | npm                                                                   | size                                                             | docs                        |62|---------------------------------------------------|-----------------------------------------------------------------------|------------------------------------------------------------------|-----------------------------|63| [@js-sdsl/stack][stack-package]                   | [![NPM Package][stack-npm-version]][stack-npm-link]                   | [![GZIP Size][stack-umd-size]][stack-umd-link]                   | [link][stack-docs]          |64| [@js-sdsl/queue][queue-package]                   | [![NPM Package][queue-npm-version]][queue-npm-link]                   | [![GZIP Size][queue-umd-size]][queue-umd-link]                   | [link][queue-docs]          |65| [@js-sdsl/priority-queue][priority-queue-package] | [![NPM Package][priority-queue-npm-version]][priority-queue-npm-link] | [![GZIP Size][priority-queue-umd-size]][priority-queue-umd-link] | [link][priority-queue-docs] |66| [@js-sdsl/vector][vector-package]                 | [![NPM Package][vector-npm-version]][vector-npm-link]                 | [![GZIP Size][vector-umd-size]][vector-umd-link]                 | [link][vector-docs]         |67| [@js-sdsl/link-list][link-list-package]           | [![NPM Package][link-list-npm-version]][link-list-npm-link]           | [![GZIP Size][link-list-umd-size]][link-list-umd-link]           | [link][link-list-docs]      |68| [@js-sdsl/deque][deque-package]                   | [![NPM Package][deque-npm-version]][deque-npm-link]                   | [![GZIP Size][deque-umd-size]][deque-umd-link]                   | [link][deque-docs]          |69| [@js-sdsl/ordered-set][ordered-set-package]       | [![NPM Package][ordered-set-npm-version]][ordered-set-npm-link]       | [![GZIP Size][ordered-set-umd-size]][ordered-set-umd-link]       | [link][ordered-set-docs]    |70| [@js-sdsl/ordered-map][ordered-map-package]       | [![NPM Package][ordered-map-npm-version]][ordered-map-npm-link]       | [![GZIP Size][ordered-map-umd-size]][ordered-map-umd-link]       | [link][ordered-map-docs]    |71| [@js-sdsl/hash-set][hash-set-package]             | [![NPM Package][hash-set-npm-version]][hash-set-npm-link]             | [![GZIP Size][hash-set-umd-size]][hash-set-umd-link]             | [link][hash-set-docs]       |72| [@js-sdsl/hash-map][hash-map-package]             | [![NPM Package][hash-map-npm-version]][hash-map-npm-link]             | [![GZIP Size][hash-map-umd-size]][hash-map-umd-link]             | [link][hash-map-docs]       |73 74## 🪒 Usage75 76You can visit our [official website](https://js-sdsl.org/) to get more information.77 78To help you have a better use, we also provide this [API document](https://js-sdsl.org/js-sdsl/index.html).79 80For previous versions of the documentation, please visit:81 82`https://js-sdsl.org/js-sdsl/previous/v${version}/index.html`83 84E.g.85 86[https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html](https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html)87 88### For browser89 90```html91<script src="https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js"></script>92<script>93    const {94      Vector,95      Stack,96      Queue,97      LinkList,98      Deque,99      PriorityQueue,100      OrderedSet,101      OrderedMap,102      HashSet,103      HashMap104    } = sdsl;105    const myOrderedMap = new OrderedMap();106    myOrderedMap.setElement(1, 2);107    console.log(myOrderedMap.getElementByKey(1)); // 2108</script>109```110 111### For npm112 113```javascript114// esModule115import { OrderedMap } from 'js-sdsl';116// commonJs117const { OrderedMap } = require('js-sdsl');118const myOrderedMap = new OrderedMap();119myOrderedMap.setElement(1, 2);120console.log(myOrderedMap.getElementByKey(1)); // 2121```122 123## 🛠 Test124 125### Unit test126 127We use [karma](https://karma-runner.github.io/) and [mocha](https://mochajs.org/) frame to do unit tests and synchronize to [coveralls](https://coveralls.io/github/js-sdsl/js-sdsl). You can run `yarn test:unit` command to reproduce it.128 129### For performance130 131We tested most of the functions for efficiency. You can go to [`gh-pages/performance.md`](https://github.com/js-sdsl/js-sdsl/blob/gh-pages/performance.md) to see our running results or reproduce it with `yarn test:performance` command.132 133You can also visit [here](https://js-sdsl.org/#/test/performance-test) to get the result.134 135## ⌨️ Development136 137Use Gitpod, a free online dev environment for GitHub.138 139[![Open in Gippod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/js-sdsl/js-sdsl)140 141Or clone locally:142 143```bash144$ git clone https://github.com/js-sdsl/js-sdsl.git145$ cd js-sdsl146$ npm install147$ npm run dev   # development mode148```149 150Then you can see the output in `dist/cjs` folder.151 152## 🤝 Contributing153 154Feel free to dive in! Open an issue or submit PRs. It may be helpful to read the [Contributor Guide](https://github.com/js-sdsl/js-sdsl/blob/main/.github/CONTRIBUTING.md).155 156### Contributors157 158Thanks goes to these wonderful people:159 160<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->161<!-- prettier-ignore-start -->162<!-- markdownlint-disable -->163<table>164  <tbody>165    <tr>166      <td align="center"><a href="https://www.linkedin.com/in/takatoshi-kondo-02a91410/"><img src="https://avatars.githubusercontent.com/u/275959?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Takatoshi Kondo</b></sub></a><br /><a href="https://github.com/js-sdsl/js-sdsl/commits?author=redboltz" title="Code">💻</a> <a href="https://github.com/js-sdsl/js-sdsl/commits?author=redboltz" title="Tests">⚠️</a></td>167      <td align="center"><a href="https://www.youtube.com/c/noname0310"><img src="https://avatars.githubusercontent.com/u/48761044?v=4?s=100" width="100px;" alt=""/><br /><sub><b>noname</b></sub></a><br /><a href="https://github.com/js-sdsl/js-sdsl/commits?author=noname0310" title="Code">💻</a></td>168    </tr>169  </tbody>170</table>171 172<!-- markdownlint-restore -->173<!-- prettier-ignore-end -->174 175<!-- ALL-CONTRIBUTORS-LIST:END -->176 177This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!178 179## ❤️ Sponsors and Backers180 181The special thanks to these sponsors or backers because they provided support at a very early stage:182 183<a href="https://eslint.org/"><img src="https://js-sdsl.org/assets/image/sponsors/eslint-logo-color.png" alt="eslint logo" width="150"></a>184 185Thanks also give to these sponsors or backers:186 187[![sponsors](https://opencollective.com/js-sdsl/tiers/sponsors.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support)188 189[![backers](https://opencollective.com/js-sdsl/tiers/backers.svg?avatarHeight=36)](https://opencollective.com/js-sdsl#support)190 191## 🪪 License192 193[MIT](https://github.com/js-sdsl/js-sdsl/blob/main/LICENSE) © [ZLY201](https://github.com/zly201)194 195[Edge-Icon]: https://js-sdsl.org/assets/image/platform/edge.png196[Firefox-Icon]: https://js-sdsl.org/assets/image/platform/firefox.png197[Chrome-Icon]: https://js-sdsl.org/assets/image/platform/chrome.png198[Safari-Icon]: https://js-sdsl.org/assets/image/platform/safari.png199[Opera-Icon]: https://js-sdsl.org/assets/image/platform/opera.png200[NodeJs-Icon]: https://js-sdsl.org/assets/image/platform/nodejs.png201 202[stack-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Stack.ts203[stack-npm-version]: https://img.shields.io/npm/v/@js-sdsl/stack204[stack-npm-link]: https://www.npmjs.com/package/@js-sdsl/stack205[stack-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js?compression=gzip&style=flat-square/206[stack-umd-link]: https://unpkg.com/@js-sdsl/stack/dist/umd/stack.min.js207[stack-docs]: https://js-sdsl.org/js-sdsl/classes/Stack.html208 209[queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/Queue.ts210[queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/queue211[queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/queue212[queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js?compression=gzip&style=flat-square/213[queue-umd-link]: https://unpkg.com/@js-sdsl/queue/dist/umd/queue.min.js214[queue-docs]: https://js-sdsl.org/js-sdsl/classes/Queue.html215 216[priority-queue-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/OtherContainer/PriorityQueue.ts217[priority-queue-npm-version]: https://img.shields.io/npm/v/@js-sdsl/priority-queue218[priority-queue-npm-link]: https://www.npmjs.com/package/@js-sdsl/priority-queue219[priority-queue-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js?compression=gzip&style=flat-square/220[priority-queue-umd-link]: https://unpkg.com/@js-sdsl/priority-queue/dist/umd/priority-queue.min.js221[priority-queue-docs]: https://js-sdsl.org/js-sdsl/classes/PriorityQueue.html222 223[vector-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Vector.ts224[vector-npm-version]: https://img.shields.io/npm/v/@js-sdsl/vector225[vector-npm-link]: https://www.npmjs.com/package/@js-sdsl/vector226[vector-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js?compression=gzip&style=flat-square/227[vector-umd-link]: https://unpkg.com/@js-sdsl/vector/dist/umd/vector.min.js228[vector-docs]: https://js-sdsl.org/js-sdsl/classes/Vector.html229 230[link-list-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/LinkList.ts231[link-list-npm-version]: https://img.shields.io/npm/v/@js-sdsl/link-list232[link-list-npm-link]: https://www.npmjs.com/package/@js-sdsl/link-list233[link-list-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js?compression=gzip&style=flat-square/234[link-list-umd-link]: https://unpkg.com/@js-sdsl/link-list/dist/umd/link-list.min.js235[link-list-docs]: https://js-sdsl.org/js-sdsl/classes/LinkList.html236 237[deque-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/SequentialContainer/Deque.ts238[deque-npm-version]: https://img.shields.io/npm/v/@js-sdsl/deque239[deque-npm-link]: https://www.npmjs.com/package/@js-sdsl/deque240[deque-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js?compression=gzip&style=flat-square/241[deque-umd-link]: https://unpkg.com/@js-sdsl/deque/dist/umd/deque.min.js242[deque-docs]: https://js-sdsl.org/js-sdsl/classes/Deque.html243 244[ordered-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedSet.ts245[ordered-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-set246[ordered-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-set247[ordered-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js?compression=gzip&style=flat-square/248[ordered-set-umd-link]: https://unpkg.com/@js-sdsl/ordered-set/dist/umd/ordered-set.min.js249[ordered-set-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedSet.html250 251[ordered-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/TreeContainer/OrderedMap.ts252[ordered-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/ordered-map253[ordered-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/ordered-map254[ordered-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js?compression=gzip&style=flat-square/255[ordered-map-umd-link]: https://unpkg.com/@js-sdsl/ordered-map/dist/umd/ordered-map.min.js256[ordered-map-docs]: https://js-sdsl.org/js-sdsl/classes/OrderedMap.html257 258[hash-set-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashSet.ts259[hash-set-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-set260[hash-set-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-set261[hash-set-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js?compression=gzip&style=flat-square/262[hash-set-umd-link]: https://unpkg.com/@js-sdsl/hash-set/dist/umd/hash-set.min.js263[hash-set-docs]: https://js-sdsl.org/js-sdsl/classes/HashSet.html264 265[hash-map-package]: https://github.com/js-sdsl/js-sdsl/blob/main/src/container/HashContainer/HashMap.ts266[hash-map-npm-version]: https://img.shields.io/npm/v/@js-sdsl/hash-map267[hash-map-npm-link]: https://www.npmjs.com/package/@js-sdsl/hash-map268[hash-map-umd-size]: https://img.badgesize.io/https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js?compression=gzip&style=flat-square/269[hash-map-umd-link]: https://unpkg.com/@js-sdsl/hash-map/dist/umd/hash-map.min.js270[hash-map-docs]: https://js-sdsl.org/js-sdsl/classes/HashMap.html271 
basant307/AI_Governance_Project · CoolFace