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
- β¨ Features
- π» Languages
- π Project Structure
- π Getting Started
- π Documentation
- π€ Contributing
- βοΈ Authors
- π How to Cite
- π License
- π Acknowledgments
- 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
Currently implemented in:
- Java (JDK 17+)
- Python (3.8+)
Future languages planned: JavaScript, C++
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] 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 - Java 17+ (for Java implementations)
- Python 3.8+ (for Python implementations)
- Git
# 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| 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) |
| 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) |
Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
Bjorn Melin
- GitHub: @BjornMelin
- LinkedIn: Bjorn Melin
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} }This project is licensed under the MIT License - see the LICENSE file for details.
- Various computer science textbooks and online resources
- Open source community
- Interview preparation materials
Made with β‘οΈ by Bjorn Melin