{"_rev":"19-f0fef119dde99ff6e2cb09f49b4fe25d","time":{"created":"2022-04-28T21:22:27.318Z","0.2.0":"2022-04-26T06:00:51.326Z","modified":"2022-04-28T21:22:27.837Z","0.3.0":"2022-04-26T07:13:42.417Z","0.3.1":"2022-04-26T16:56:00.688Z","0.3.2":"2022-04-26T16:58:35.219Z","0.3.3":"2022-04-26T18:07:55.271Z","0.3.4":"2022-04-27T13:47:25.492Z","0.3.5":"2022-04-28T17:50:09.788Z","0.3.6":"2022-04-28T17:54:45.249Z","0.3.7":"2022-04-28T18:04:17.117Z","0.3.8":"2022-04-28T19:07:52.296Z","0.3.9":"2022-04-28T19:27:24.810Z","0.3.10":"2022-04-28T19:45:05.366Z","0.3.11":"2022-04-28T19:50:32.538Z","1.0.0":"2022-04-28T21:22:27.566Z"},"_id":"@anorcle/dsa","name":"@anorcle/dsa","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anorcle/dsa","version":"1.0.0","description":"Implementation of Complex Data Structures and Algorithms for Web","type":"module","main":"dist/cjs/index.js","module":"dist/mjs/index.js","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/mjs/index.js"}},"scripts":{"build":"rm -fr dist/* && tsc -p tsconfig-mjs.json && tsc -p tsconfig-cjs.json && node fix-module-type.js","docs":"rm -fr docs/* && typedoc --options typedoc.json","format":"prettier --write \"src/**/*.(js|ts)\"","lint":"eslint src --ext .js,.ts","lint:fix":"eslint src --fix --ext .js,.ts","test":"jest --config jest.config.js","prepublish":"npm run test && npm run build && npm run docs","publish":"npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/anorcle/dsa.git"},"keywords":["data-structures","algorithms","dsa","stl"],"author":{"name":"Suraj Jha","email":"contact@jhasuraj.com","url":"https://jhasuraj.com"},"license":"MIT","bugs":{"url":"https://github.com/anorcle/dsa.git/issues"},"homepage":"https://anorcle.github.io/dsa/","devDependencies":{"@types/jest":"^26.0.15","@typescript-eslint/eslint-plugin":"^4.5.0","@typescript-eslint/parser":"^4.5.0","eslint":"^7.11.0","eslint-plugin-jest":"^24.1.0","jest":"^26.6.0","prettier":"^2.3.0","ts-jest":"^26.4.1","typedoc":"^0.22.15","typescript":"^4.6.3"},"types":"./dist/cjs/index.d.ts","gitHead":"22a607f7e87136b29512bc1ef85d4ffca89b0331","_id":"@anorcle/dsa@1.0.0","_nodeVersion":"18.0.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-yQHUiXY060gUgJWWZWy5zccwG8wmvf8bzlsf8xlWZfa8vxHON37pCIuVU0GuXz2fmJKfn+YvGFlBD8dSIqkP+w==","shasum":"6c6664a5b2c5f9218dbc5a590dc25ca7a71ff672","tarball":"https://registry.npmjs.org/@anorcle/dsa/-/dsa-1.0.0.tgz","fileCount":53,"unpackedSize":72084,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJkC2dYofkk5CnRltmHPK/GvWIQSThQUwGQmGj7Us0uAiEAghNUhkPchruD47bxhXE7hso2n+59xcvSKJYO8z7yADM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiawWTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrnhg//bvUI3EygTiR1xOSr5MfVAmff/onE0PpZrcPVpltHJwALSJNb\r\neMco56WJh2CEGxlFoAEAJyIHsbWjoHmjAjfy6L+Tur0fpfDp+vJx7I47oQdW\r\n9lU+d+N2fNePZwgxax2cCNU4yPEIHpplBFEmu9XB06GsszewgQgI2E5o6d2M\r\ncdYA+jGD14kEy6giHEJ0L4rUVgD43O4PAabhUh05zdPLe34g0FC1BPLBHJq0\r\n4w05/p2J/9nv5PskFP5ZqJUOVM2F6ER6g6uB/C9eHI4bRWqFyEjSSp7Yr5Lq\r\nYuHnri8Dh5s3I1JEbJHySHMrPKIwGViDJ0uFP17ljXm4+Hr7R58xK5OwJdv6\r\n33ofTMNwXw2blJPJN8M31ZPS70iZ3lCz+u9qiq09+gb752h98AmcOL3YtSvm\r\nMPwruUyZEMv9TFhj9NgTJe2iD6fKUD9XkOC0yTq/3wDkdsvzaKYvCqTILjYt\r\njfyL4A+MKHnjPwmYweXzh5axXH+yKOLMOrwOzYVbFgRTVoE0/3xKQ4bNENXZ\r\ny45zZiQcRYznvKY48uaBTpsQcTWLIGKH/cqzcBh2krYC4zsgJBfWeBr3B3Hp\r\nhfbWFvqtSJ3MoZD9fxLsXVvavRGiHzdUSMi3ZaRrjIP9tojlTFh+xrroV83F\r\n5B/iArb1Eht6IcjU7Nstopd1uCFSum6g4Wc=\r\n=jkvG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jhasuraj01","email":"contact@jhasuraj.com"},"directories":{},"maintainers":[{"name":"jhasuraj01","email":"contact@jhasuraj.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dsa_1.0.0_1651180947436_0.8393097993308993"},"_hasShrinkwrap":false}},"maintainers":[{"name":"jhasuraj01","email":"contact@jhasuraj.com"}],"description":"Implementation of Complex Data Structures and Algorithms for Web","homepage":"https://anorcle.github.io/dsa/","keywords":["data-structures","algorithms","dsa","stl"],"repository":{"type":"git","url":"git+https://github.com/anorcle/dsa.git"},"author":{"name":"Suraj Jha","email":"contact@jhasuraj.com","url":"https://jhasuraj.com"},"bugs":{"url":"https://github.com/anorcle/dsa.git/issues"},"license":"MIT","readme":"# Data Structures and Algorithms For Web\r\n\r\nData Structures and Algorithms are highly useful for development\r\nof complex features in any Application. Here in this project we\r\nare targeting to implement most of the important and useful Data\r\nStructures and Algorithms for web Developers.\r\n\r\n![issues](https://img.shields.io/github/issues/anorcle/dsa)\r\n![License](https://img.shields.io/github/license/anorcle/dsa)\r\n[![Tweet](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fanorcle%2Fdsa)](https://twitter.com/intent/tweet?text=Data+Structures+and+Algorithms+for+Web+😉:&url=https%3A%2F%2Fgithub.com%2Fanorcle%2Fdsa)\r\n[![Website](https://img.shields.io/website?url=https%3A%2F%2Fanorcle.github.io%2Fdsa%2F)](https://anorcle.github.io/dsa/)\r\n[![GitHub](https://img.shields.io/github/stars/anorcle/dsa?style=social)](https://github.com/anorcle/dsa/)\r\n\r\n## [List of Implemented Data Structures](https://anorcle.github.io/dsa/modules.html)\r\n- [AVL Tree](https://anorcle.github.io/dsa/classes/AVL.html)\r\n- [Binary Search Tree](https://anorcle.github.io/dsa/classes/BST.html)\r\n- [Doubly Linked List](https://anorcle.github.io/dsa/classes/LinkedList.html)\r\n- [Set (Ordered)](https://anorcle.github.io/dsa/classes/Set.html)\r\n- [Priority Queue](https://anorcle.github.io/dsa/classes/PriorityQueue.html)\r\n  - Min Heap\r\n  - Max Heap\r\n- [Queue](https://anorcle.github.io/dsa/classes/Queue.html)\r\n- [Deque](https://anorcle.github.io/dsa/classes/Deque.html)\r\n- [Stack](https://anorcle.github.io/dsa/classes/Stack.html)\r\n\r\n## Installation\r\n```bash\r\nnpm i @anorcle/dsa\r\n```\r\n\r\n## Import\r\n\r\n### ECMAScript Modules\r\nImport Everything\r\n```typescript\r\nimport * as dsa from '@anorcle/dsa';\r\n```\r\n\r\nImport Only Required Modules\r\n```typescript\r\nimport { AVL, BST, Deque, LinkedList, PriorityQueue, Queue, Set, Stack } from '@anorcle/dsa';\r\n```\r\n\r\n### CommonJS\r\nImport Everything\r\n```typescript\r\nconst dsa = require('@anorcle/dsa')\r\n```\r\n\r\nImport Only Required Modules\r\n```typescript\r\nconst { AVL, BST, Deque, LinkedList, PriorityQueue, Queue, Set, Stack } = require('@anorcle/dsa')\r\n```\r\n\r\n\r\n## Examples\r\n\r\n### Max Heap\r\nA Max Heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node.\r\n\r\n<details open>\r\n<summary style=\"font-size: 1.2em\">TypeScript</summary>\r\n\r\n```ts\r\nimport { PriorityQueue } from \"@anorcle/dsa\";\r\n\r\n// compare function for Max Heap\r\nconst compare = (a: number, b: number): -1 | 0 | 1 => {\r\n    if (a < b)\r\n        return -1;\r\n    if (a > b)\r\n        return +1;\r\n    return 0;\r\n};\r\n\r\n// create new Priority Queue of Numbers\r\nconst pq = new PriorityQueue<number>(compare);\r\n\r\npq.push(3);\r\npq.push(1);\r\npq.push(100);\r\n\r\nconsole.log(pq.front) // 100\r\n\r\n// remove the top element from priority queue and return it\r\npq.pop()\r\n```\r\n</details>\r\n\r\n\r\n<details>\r\n<summary style=\"font-size: 1.2em\">JavaScript</summary>\r\n\r\n```js\r\nimport { PriorityQueue } from \"@anorcle/dsa\";\r\n\r\n// compare function for Max Heap\r\nconst compare = (a, b) => {\r\n    if (a < b)\r\n        return -1;\r\n    if (a > b)\r\n        return +1;\r\n    return 0;\r\n};\r\n\r\n// create new Priority Queue of Numbers\r\nconst pq = new PriorityQueue(compare);\r\npq.push(3);\r\npq.push(1);\r\npq.push(100);\r\nconsole.log(pq.front); // 100\r\n\r\n// remove the top element from priority queue and return it\r\npq.pop();\r\n```\r\n</details>\r\n\r\n### Min Heap\r\nA Min Heap is a complete binary tree in which the value in each internal node is smaller than or equal to the values in the children of that node.\r\n\r\n<details open>\r\n<summary style=\"font-size: 1.2em\">TypeScript</summary>\r\n\r\n```ts\r\nimport { PriorityQueue } from \"@anorcle/dsa\";\r\n\r\n// compare function for Min Heap\r\nconst compare = (a: number, b: number): -1 | 0 | 1 => {\r\n    if (a < b)\r\n        return +1;\r\n    if (a > b)\r\n        return -1;\r\n    return 0;\r\n};\r\n\r\n// create new Priority Queue of Numbers\r\nconst pq = new PriorityQueue<number>(compare);\r\n\r\npq.push(3);\r\npq.push(1);\r\npq.push(100);\r\n\r\nconsole.log(pq.front) // 1\r\n\r\n// remove the top element from priority queue and return it\r\npq.pop()\r\n```\r\n</details>\r\n\r\n<details>\r\n<summary style=\"font-size: 1.2em\">JavaScript</summary>\r\n\r\n```js\r\nimport { PriorityQueue } from \"@anorcle/dsa\";\r\n\r\n// compare function for Min Heap\r\nconst compare = (a, b) => {\r\n    if (a < b)\r\n        return +1;\r\n    if (a > b)\r\n        return -1;\r\n    return 0;\r\n};\r\n\r\n// create new Priority Queue of Numbers\r\nconst pq = new PriorityQueue(compare);\r\npq.push(3);\r\npq.push(1);\r\npq.push(100);\r\nconsole.log(pq.front); // 1\r\n\r\n// remove the top element from priority queue and return it\r\npq.pop();\r\n```\r\n</details>\r\n\r\n### Stack\r\nStack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).\r\n```ts\r\nimport { Stack } from \"@anorcle/dsa\";\r\n\r\nconst stack = new Stack<number>();\r\nstack.push(3);\r\nstack.push(1);\r\nstack.push(100);\r\n\r\nconsole.log(stack.top) // 100\r\n\r\n// Remove Top Element from stack\r\nstack.pop()\r\n\r\nconsole.log(stack.top) // 1\r\n```\r\n\r\n### Queue\r\nA Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO)\r\n```ts\r\nimport { Queue } from \"@anorcle/dsa\";\r\n\r\nconst queue = new Queue<number>();\r\nqueue.push(3);\r\nqueue.push(1);\r\nqueue.push(100);\r\n\r\nconsole.log(queue.front) // 3\r\n\r\n// Remove First Element from Queue\r\nqueue.pop()\r\n\r\nconsole.log(queue.front) // 1\r\n```\r\n","readmeFilename":"README.md"}