{"id":23197695,"url":"https://github.com/behzadam/algorithms","last_synced_at":"2026-02-19T05:01:02.563Z","repository":{"id":253119989,"uuid":"831414868","full_name":"behzadam/algorithms","owner":"behzadam","description":"This repository is a collection of TypeScript algorithms and data structures.","archived":false,"fork":false,"pushed_at":"2025-11-24T19:46:01.000Z","size":234,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T02:54:17.012Z","etag":null,"topics":["algorithm","algorithms","algorithms-and-data-structures","data-structures","javascript-algorithms","patterns","search-algorithm","sorting-algorithms","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"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/behzadam.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-20T13:34:37.000Z","updated_at":"2025-11-24T19:46:05.000Z","dependencies_parsed_at":"2025-01-24T20:25:47.199Z","dependency_job_id":"bed2c9f2-79df-4dfe-9aec-af9c115c6e00","html_url":"https://github.com/behzadam/algorithms","commit_stats":null,"previous_names":["behzadam/algorithms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/behzadam/algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behzadam%2Falgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behzadam%2Falgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behzadam%2Falgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behzadam%2Falgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behzadam","download_url":"https://codeload.github.com/behzadam/algorithms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behzadam%2Falgorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T04:38:07.383Z","status":"ssl_error","status_checked_at":"2026-02-19T04:35:50.016Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithm","algorithms","algorithms-and-data-structures","data-structures","javascript-algorithms","patterns","search-algorithm","sorting-algorithms","typescript"],"created_at":"2024-12-18T14:37:05.315Z","updated_at":"2026-02-19T05:01:02.557Z","avatar_url":"https://github.com/behzadam.png","language":"TypeScript","readme":"\n\u003cimg width=\"1280\" height=\"640\" alt=\"github-cover-tech-1764013466854\" src=\"https://github.com/user-attachments/assets/98ef6f60-90f1-4b6f-9eac-37f8f529f3ea\" /\u003e\n\n# 🚀 TypeScript Algorithms and Data Structures\n\n**A comprehensive collection of algorithms, data structures, and coding challenges implemented in TypeScript**\n\n[![GitHub top language](https://img.shields.io/github/languages/top/behzadam/algorithms?style=for-the-badge)](https://github.com/behzadam/algorithms)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b6d0142c6cb448e28ea0dcc88b77b062?style=for-the-badge)](https://app.codacy.com/gh/behzadam/algorithms/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Lines of code](https://img.shields.io/tokei/lines/github/behzadam/algorithms?style=for-the-badge)](https://github.com/behzadam/algorithms)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n\n[Features](#-features) • [Quick Start](#-getting-started) • [Documentation](#-documentation)\n\n---\n\n## 📋 Table of Contents\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand\u003c/summary\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n- [🚀 TypeScript Algorithms and Data Structures](#-typescript-algorithms-and-data-structures)\n  - [📋 Table of Contents](#-table-of-contents)\n  - [🎯 Introduction](#-introduction)\n  - [✨ Features](#-features)\n  - [📚 Documentation](#-documentation)\n    - [📦 Data Structures](#-data-structures)\n    - [🔍 Algorithms](#-algorithms)\n      - [🔎 Search Algorithms](#-search-algorithms)\n      - [🔄 Sorting Algorithms](#-sorting-algorithms)\n    - [💻 Coding Challenges](#-coding-challenges)\n      - [👉 Two Pointers](#-two-pointers)\n    - [🛠️ Utilities](#️-utilities)\n  - [🚀 Getting Started](#-getting-started)\n    - [Prerequisites](#prerequisites)\n    - [Installation](#installation)\n  - [💻 Development](#-development)\n    - [Available Scripts](#available-scripts)\n    - [Project Structure](#project-structure)\n  - [📝 License](#-license)\n  - [📧 Contact](#-contact)\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c/details\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n---\n\n## 🎯 Introduction\n\nThis repository is a **comprehensive collection** of TypeScript algorithms and data structures designed for educational purposes. It serves as a reference for developers who want to learn, practice, and master TypeScript while understanding fundamental computer science concepts.\n\n\u003e 💡 **Note:** This repository includes code and patterns from the [JavaScript Algorithms](https://github.com/trekhleb/javascript-algorithms) repository, translated and enhanced from JavaScript to TypeScript.\n\n---\n\n## ✨ Features\n\n- 🔍 **Well-documented** code with TypeScript types\n- ✅ **Fully tested** with Jest test suites\n- 📚 **Educational** focus with clear implementations\n- 🎨 **Clean code** following best practices\n- 🚀 **Production-ready** implementations\n- 🔄 **Regularly updated** with new algorithms and patterns\n\n---\n\n## 📚 Documentation\n\n### 📦 Data Structures\n\n| Data Structure       | Description                          | Implementation                                                       |\n| -------------------- | ------------------------------------ | -------------------------------------------------------------------- |\n| **HashTable**        | Key-value mapping with hash function | [View Code](src/data-structure/hash-table/hash-table.ts)             |\n| **MinHeap**          | Binary heap with minimum root        | [View Code](src/data-structure/heap/min-heap.ts)                     |\n| **MaxHeap**          | Binary heap with maximum root        | [View Code](src/data-structure/heap/max-heap.ts)                     |\n| **LinkedList**       | Linear collection of nodes           | [View Code](src/data-structure/linked-list/linked-list.ts)           |\n| **Queue**            | FIFO (First In First Out) structure  | [View Code](src/data-structure/queue/queue.ts)                       |\n| **Stack**            | LIFO (Last In First Out) structure   | [View Code](src/data-structure/stack/stack.ts)                       |\n| **MaxPriorityQueue** | Priority queue with max priority     | [View Code](src/data-structure/priority-queue/max-priority-queue.ts) |\n| **MinPriorityQueue** | Priority queue with min priority     | [View Code](src/data-structure/priority-queue/min-priority-queue.ts) |\n| **Trie**             | Prefix tree for string operations    | [View Code](src/data-structure/trie/trie.ts)                         |\n| **BinaryTree**       | Hierarchical tree structure          | [View Code](src/data-structure/tree/binary-tree.ts)                  |\n\n### 🔍 Algorithms\n\n| Algorithm              | Category | Description                           | Implementation                                                     |\n| ---------------------- | -------- | ------------------------------------- | ------------------------------------------------------------------ |\n| **Binary Search**      | Search   | Efficient search in sorted arrays     | [View Code](src/algorithms/search/binary-search/binary-search.ts)  |\n| **Linear Search**      | Search   | Simple sequential search              | [View Code](src/algorithms/search/linear-search/linear-search.ts)  |\n| **Quick Sort**         | Sort     | Divide and conquer sorting algorithm  | [View Code](src/algorithms/sort/quick/quick-sort.ts)               |\n| **Bubble Sort**        | Sort     | Simple comparison-based sort          | [View Code](src/algorithms/sort/bubble-sort/bubble-sort.ts)        |\n| **Bubble Sort Simple** | Sort     | Simplified bubble sort implementation | [View Code](src/algorithms/sort/bubble-sort/bubble-sort-simple.ts) |\n\n### 💻 Coding Challenges\n\n| Challenge           | Category     | Description                                   | Implementation                                                   |\n| ------------------- | ------------ | --------------------------------------------- | ---------------------------------------------------------------- |\n| **Pair Sum Sorted** | Two Pointers | Find pairs in sorted array that sum to target | [View Code](src/code-challanges/two-pointers/pair-sum-sorted.ts) |\n\n### 🛠️ Utilities\n\n- **[Comparator](src/utils/comparator.ts)** - Comparison functions for sorting and searching\n- **[Range](src/utils/range.ts)** - Utility for generating number ranges\n- **[Type Definitions](src/types/)** - Common TypeScript type definitions\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- **Node.js** (v16 or higher)\n- **pnpm** (or npm/yarn)\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/behzadam/algorithms.git\n   cd algorithms\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   pnpm install\n   ```\n\n3. **Run tests**\n\n   ```bash\n   pnpm test\n   ```\n\n---\n\n## 💻 Development\n\n### Available Scripts\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTest Commands\u003c/b\u003e\u003c/summary\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n```bash\n# Run all tests\npnpm test\n\n# Run tests in watch mode\npnpm test:watch\n\n# Run tests with coverage\npnpm test:coverage\n```\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCode Quality Commands\u003c/b\u003e\u003c/summary\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n```bash\n# Check code formatting\npnpm format:check\n\n# Fix code formatting\npnpm format:fix\n\n# Run ESLint\npnpm lint\n\n# Fix ESLint issues\npnpm lint:fix\n```\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c/details\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n### Project Structure\n\n```text\nalgorithms/\n├── src/\n│   ├── algorithms/          # Algorithm implementations\n│   │   ├── search/         # Search algorithms\n│   │   └── sort/           # Sorting algorithms\n│   ├── code-challanges/    # Coding challenges\n│   ├── data-structure/     # Data structure implementations\n│   ├── types/              # TypeScript type definitions\n│   └── utils/              # Utility functions\n├── jest.config.js          # Jest configuration\n├── tsconfig.json           # TypeScript configuration\n└── package.json            # Project dependencies\n```\n\n---\n\n## 📝 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 📧 Contact\n\nHave questions or suggestions? Feel free to reach out!\n\n- **Email:** [behzad.am@gmail.com](mailto:behzad.am@gmail.com)\n- **GitHub:** [@behzadam](https://github.com/behzadam)\n\n---\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cdiv align=\"center\"\u003e\n\n**⭐ Star this repo if you find it helpful!**\n\nMade with ❤️ by [behzadam](https://github.com/behzadam)\n\n\u003c/div\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehzadam%2Falgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehzadam%2Falgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehzadam%2Falgorithms/lists"}