This repository contains implementations of various data structures and algorithms in TypeScript. The code serves as a reference and learning resource for developers interested in understanding and applying these concepts in their projects.
The purpose of this repository is to provide clear and concise implementations of common data structures and algorithms using TypeScript. By exploring the code, developers can gain insights into how these fundamental concepts can be implemented and utilized in real-world scenarios.
The following data structures are implemented in this repository:
- Binary Search Tree
- Trie (Prefix Tree)
- LRU Cache
Each data structure is defined using TypeScript interfaces and classes, ensuring type safety and encapsulation.
The repository includes the following algorithm implementations:
- Dijkstra's Shortest Path Algorithm
The algorithms are implemented as standalone functions, taking advantage of TypeScript's type system to ensure proper usage.
The code also demonstrates the usage of design patterns to enhance code reusability and maintainability. The following design pattern is showcased:
- Decorator Pattern
The Decorator pattern is applied to a simple Calculator class, logging the input arguments and results of the decorated method.
To use the code in this repository, follow these steps:
- Clone the repository:
git clone https://github.com/jayinmt/algorithms-and-data-structures.git
- Install the necessary dependencies (if any).
- Explore the source code in the
algorithms-and-data-structures.ts
file. - Modify and extend the code as per your requirements.
- Run the code using a TypeScript compiler or integrate it into your project.
Feel free to customize and build upon the provided implementations to suit your specific needs.
This project is licensed under the MIT License. See the LICENSE file for more information.