Skip to content

πŸ› οΈ A comprehensive collection of data structures and algorithms implemented in multiple programming languages. Perfect for learning, interviews, and competitive programming!

License

Notifications You must be signed in to change notification settings

BjornMelin/data-structures-and-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Data Structures and Algorithms 🎯

Java Python License PRs Welcome

A comprehensive collection of data structures and algorithms implemented in multiple programming languages. Perfect for learning, interviews, and competitive programming!

✨ Features β€’ πŸ’» Languages β€’ πŸ“ Structure β€’ πŸš€ Quick Start β€’ 🀝 Contributing

πŸ“‘ Table of Contents

✨ Features

  • Clean, efficient implementations of common data structures
  • Well-documented algorithms with time and space complexity analysis
  • Comprehensive test coverage for all implementations
  • Language-specific best practices and idioms
  • Interview preparation materials and example problems
  • Multiple implementation approaches with comparisons

πŸ’» Languages

Currently implemented in:

  • Java (JDK 17+)
  • Python (3.8+)

Future languages planned: JavaScript, C++

πŸ“ Project Structure

graph TD
    A[algorithms-and-data-structures] --> B[java]
    A[algorithms-and-data-structures] --> C[python]
    A --> D[docs]
    B --> E[src/algorithms]
    B --> F[src/data_structures]
    B --> G[tests]
    C --> H[algorithms]
    H --> I[sorting]
    H --> J[searching]
Loading
Click to expand full directory structure
algorithms-and-data-structures/
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ docs/
β”‚   └── implementation_guides/
β”œβ”€β”€ java/
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ algorithms/
β”‚   β”‚   β”‚   β”œβ”€β”€ sorting/
β”‚   β”‚   β”‚   β”œβ”€β”€ searching/
β”‚   β”‚   β”‚   └── graph/
β”‚   β”‚   └── data_structures/
β”‚   β”‚       β”œβ”€β”€ linear/
β”‚   β”‚       β”œβ”€β”€ trees/
β”‚   β”‚       └── graphs/
β”‚   └── tests/
└── python/
    β”œβ”€β”€ README.md
    β”œβ”€β”€ algorithms/
    β”‚   β”œβ”€β”€ sorting/
    β”‚   β”‚   β”œβ”€β”€ bubble_sort/
    β”‚   β”‚   β”œβ”€β”€ bucket_sort/
    β”‚   β”‚   β”œβ”€β”€ counting_sort/
    β”‚   β”‚   β”œβ”€β”€ heap_sort/
    β”‚   β”‚   β”œβ”€β”€ insertion_sort/
    β”‚   β”‚   β”œβ”€β”€ merge_sort/
    β”‚   β”‚   β”œβ”€β”€ quick_sort/
    β”‚   β”‚   β”œβ”€β”€ radix_sort/
    β”‚   β”‚   β”œβ”€β”€ selection_sort/
    β”‚   β”‚   └── tim_sort/
    β”‚   └── searching/
    β”‚       β”œβ”€β”€ binary_search/
    β”‚       β”œβ”€β”€ exponential_search/
    β”‚       β”œβ”€β”€ fibonacci_search/
    β”‚       β”œβ”€β”€ hash_based_search/
    β”‚       β”œβ”€β”€ interpolation_search/
    β”‚       β”œβ”€β”€ jump_search/
    β”‚       β”œβ”€β”€ linear_search/
    β”‚       └── ternary_search/
    β”œβ”€β”€ tests/
    β”‚   └── algorithms/
    β”‚       β”œβ”€β”€ searching/
    β”‚       β”‚   β”œβ”€β”€ test_binary_search.py
    β”‚       β”‚   β”œβ”€β”€ test_exponential_search.py
    β”‚       β”‚   β”œβ”€β”€ test_fibonacci_search.py
    β”‚       β”‚   β”œβ”€β”€ test_hash_based_search.py
    β”‚       β”‚   β”œβ”€β”€ test_interpolation_search.py
    β”‚       β”‚   β”œβ”€β”€ test_jump_search.py
    β”‚       β”‚   β”œβ”€β”€ test_linear_search.py
    β”‚       β”‚   └── test_ternary_search.py
    β”‚       └── sorting/
    β”‚           β”œβ”€β”€ test_bubble_sort.py
    β”‚           β”œβ”€β”€ test_bucket_sort.py
    β”‚           β”œβ”€β”€ test_counting_sort.py
    β”‚           β”œβ”€β”€ test_heap_sort.py
    β”‚           β”œβ”€β”€ test_insertion_sort.py
    β”‚           β”œβ”€β”€ test_merge_sort.py
    β”‚           β”œβ”€β”€ test_quick_sort.py
    β”‚           β”œβ”€β”€ test_radix_sort.py
    β”‚           β”œβ”€β”€ test_selection_sort.py
    β”‚           └── test_tim_sort.py
    β”œβ”€β”€ benchmarks/
    β”‚   β”œβ”€β”€ search_benchmark_results.md
    β”‚   └── sort_benchmark_results.md
    β”œβ”€β”€ requirements.txt
    └── setup.py

πŸš€ Getting Started

Prerequisites

  • Java 17+ (for Java implementations)
  • Python 3.8+ (for Python implementations)
  • Git

Setup

# Clone repository
git clone https://github.com/BjornMelin/algorithms-and-data-structures.git
cd algorithms-and-data-structures

# For Java
cd java
./gradlew build

# For Python
cd python
python -m pip install -r requirements.txt
python -m pytest

πŸ“š Documentation

Data Structures

Structure Java Python Time Complexity (Average)
Linked List βœ… ❌ Access: O(n), Insert: O(1)
Binary Tree βœ… ❌ Search: O(log n)
Hash Table βœ… ❌ Search: O(1)
Stack βœ… ❌ Push/Pop: O(1)
Queue βœ… ❌ Enqueue/Dequeue: O(1)

Algorithms

Algorithm Category Java Python Time Complexity
Quick Sort Sorting βœ… βœ… O(n log n)
Merge Sort Sorting βœ… βœ… O(n log n)
Heap Sort Sorting βœ… βœ… O(n log n)
Binary Search Searching βœ… βœ… O(log n)
Linear Search Searching ❌ βœ… O(n)
Jump Search Searching ❌ βœ… O(√n)
Interpolation Search Searching ❌ βœ… O(log log n)
Exponential Search Searching ❌ βœ… O(log n)
Fibonacci Search Searching ❌ βœ… O(log n)
Ternary Search Searching ❌ βœ… O(log n)
Hash-based Search Searching ❌ βœ… O(1)
Bubble Sort Sorting ❌ βœ… O(n^2)
Selection Sort Sorting ❌ βœ… O(n^2)
Insertion Sort Sorting ❌ βœ… O(n^2)
Radix Sort Sorting ❌ βœ… O(nk)
Counting Sort Sorting ❌ βœ… O(n + k)
Bucket Sort Sorting ❌ βœ… O(n + k)
Tim Sort Sorting ❌ βœ… O(n log n)

🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.

✍️ Authors

Bjorn Melin

πŸ“š How to Cite

If you use this repository in your research or project, please cite it as:

@misc{melin2024dsa,
  author = {Melin, Bjorn},
  title = {Data Structures and Algorithms Implementation},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/BjornMelin/algorithms-and-data-structures}},
  commit = {master}
}

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Various computer science textbooks and online resources
  • Open source community
  • Interview preparation materials

Made with ⚑️ by Bjorn Melin

About

πŸ› οΈ A comprehensive collection of data structures and algorithms implemented in multiple programming languages. Perfect for learning, interviews, and competitive programming!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published