{"id":24665075,"url":"https://github.com/alisawari/ts-data-structure","last_synced_at":"2026-01-28T16:37:05.132Z","repository":{"id":96810571,"uuid":"455821617","full_name":"AliSawari/ts-data-structure","owner":"AliSawari","description":"Implemented most useful and important Data Structures used in Software Development, All With TypeScript 🌟","archived":false,"fork":false,"pushed_at":"2024-11-16T16:32:26.000Z","size":174,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T17:26:28.470Z","etag":null,"topics":["data-structures","datastructures","typescript"],"latest_commit_sha":null,"homepage":"https://alisawari.github.io/ts-data-structure/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliSawari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-05T09:00:02.000Z","updated_at":"2024-11-16T16:32:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9f2b5e8-45ad-4b1a-bdea-fb2dab3495b1","html_url":"https://github.com/AliSawari/ts-data-structure","commit_stats":null,"previous_names":["alisawari/ts-data-structure"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSawari%2Fts-data-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSawari%2Fts-data-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSawari%2Fts-data-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSawari%2Fts-data-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliSawari","download_url":"https://codeload.github.com/AliSawari/ts-data-structure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235674060,"owners_count":19027515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","datastructures","typescript"],"created_at":"2025-01-26T06:28:34.795Z","updated_at":"2025-10-08T01:32:17.211Z","avatar_url":"https://github.com/AliSawari.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structure and Algorithms - TypeScript [![Build \u0026 Test](https://github.com/AliSawari/js-data-structure/actions/workflows/node.js.yml/badge.svg)](https://github.com/AliSawari/js-data-structure/actions/workflows/node.js.yml)\n\n**Implemented most useful and important Data Structures used in Software Development, All With TypeScript 🌟**\n\n## Table of Contents\n\n- [Introduction](#data-structure-with-typeScript)\n- [Examples](#examples)\n\n## List of Implemented Data Structures\n\n- [x] Linked Lists\n  1. Simple Linked List\n  2. Doubly Linked Lists\n- [x] Stacks\n- [x] Queues\n- [ ] Trees\n\n## Data Structure with TypeScript\n\nthe benefits of using the Type system from TypeScript is the ability to create new types alongside the class\ndefinitions, which allows you to implement the Data Structure types easily and correctly.\n\nI've tried to be as close as possible to the real use cases of Data Structures in Real life and\nin the classic definitions.\n\n## Examples\n\nhere's a quick type definition of Linked List.\n\n```ts\ntype LinkedListType = {\n  length: number;\n  head: NodeType | null;\n  tail: NodeType | null;\n  push?(value: any): LinkedListType;\n  pop?(): NodeType | unknown;\n  shift?(): NodeType | unknown;\n  unshift?(value: any): LinkedListType;\n  get?(index: number): NodeType | unknown;\n  set?(index: number, value: any): boolean;\n  insert?(index: number, value: any): void;\n  remove?(value: any): NodeType | unknown;\n  reverse?(): void;\n  log?(): void;\n};\n```\n\nyou can see that each property or method has a declared type. the `value` of a linked list however can be different, thats why `any` would make sense. A Generic type will be implemented soon.\n\n### Run \n\nYou can run the example and testing files with this command:\n\n\n```bash\nnpm run examples\n```\n\nTo compile the project, simply run:\n\n```bash\nnpm run build\n```\n\n### Testing\n\nRun tests with `npm test`.\n\nEach Test file is related to one data structure(each file for subgroups)\nthe goal of the unit testing files is to assert the correctness of the implemented Data Structure. you can find tests in the [tests](./tests/) Directory.\n\n### License\n\nThis repo is under MIT License\n\nHappy Hacking 🥷\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisawari%2Fts-data-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falisawari%2Fts-data-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisawari%2Fts-data-structure/lists"}