{"id":25343557,"url":"https://github.com/saadsalmanakram/ds-bigo-complexity","last_synced_at":"2025-04-08T14:27:24.574Z","repository":{"id":259744715,"uuid":"849732929","full_name":"saadsalmanakram/DS-BigO-Complexity","owner":"saadsalmanakram","description":"It's all about Data Structures... This repository is designed to provide a comprehensive guide to understanding, implementing, and mastering data structures from the ground up.","archived":false,"fork":false,"pushed_at":"2025-04-05T14:41:19.000Z","size":97,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T15:30:46.315Z","etag":null,"topics":["bigonotation","data-structures","datastructures","datastructures-algorithms","timecomplexity"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saadsalmanakram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-30T06:23:32.000Z","updated_at":"2025-04-05T14:41:22.000Z","dependencies_parsed_at":"2025-01-28T05:22:24.076Z","dependency_job_id":"c5d43e37-022c-4665-aad2-5929eb15a0e2","html_url":"https://github.com/saadsalmanakram/DS-BigO-Complexity","commit_stats":null,"previous_names":["saadsalmanakram/ds-bigo-complexity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDS-BigO-Complexity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDS-BigO-Complexity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDS-BigO-Complexity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDS-BigO-Complexity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saadsalmanakram","download_url":"https://codeload.github.com/saadsalmanakram/DS-BigO-Complexity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247859423,"owners_count":21008100,"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":["bigonotation","data-structures","datastructures","datastructures-algorithms","timecomplexity"],"created_at":"2025-02-14T10:39:34.664Z","updated_at":"2025-04-08T14:27:24.271Z","avatar_url":"https://github.com/saadsalmanakram.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n---\n\n# 📚 DS-BigO-Complexity  \n\n![Algorithms and Complexity](https://cdn.pixabay.com/photo/2023/02/08/08/50/frequency-wave-7776034_1280.jpg)  \n\n## 📝 Introduction  \n\n**DS-BigO-Complexity** is a comprehensive guide to understanding **Data Structures, Algorithms, and Time Complexity**. This repository is designed for beginners and intermediate learners who want to strengthen their problem-solving skills and optimize their code for efficiency.  \n\n🔹 Learn about common **data structures** like arrays, linked lists, trees, graphs, and heaps.  \n🔹 Implement and analyze **sorting and searching algorithms**.  \n🔹 Master **Big-O Notation** and understand **time \u0026 space complexity**.  \n🔹 Solve real-world **coding problems** with optimized solutions.  \n\n---\n\n## 🚀 Features  \n\n- **In-depth explanations** of fundamental data structures  \n- **Hands-on implementations** in Python  \n- **Big-O Complexity Analysis** for each algorithm  \n- **Visual representations** of sorting \u0026 searching algorithms  \n- **Interview-style problems** with optimal solutions  \n- **Practice problems \u0026 challenges**  \n\n---\n\n## 📌 Prerequisites  \n\nBefore getting started, ensure you have:  \n\n- **Python 3.x** installed → [Download Here](https://www.python.org/downloads/)  \n- Basic knowledge of programming concepts  \n\n---\n\n## 📂 Repository Structure  \n\n```\nDS-BigO-Complexity/\n│── data_structures/        # Implementations of stacks, queues, linked lists, trees, etc.\n│── algorithms/             # Sorting, searching, dynamic programming, graph algorithms\n│── complexity_analysis/    # Big-O notation, best-case, worst-case, average-case analysis\n│── interview_questions/    # Common DSA questions from tech interviews\n│── visualizations/         # Graphical representations of sorting \u0026 searching algorithms\n│── README.md               # Project documentation\n└── requirements.txt        # Python dependencies\n```\n\n---\n\n## ⏳ Understanding Big-O Notation  \n\nBig-O notation is used to classify algorithms according to their **runtime complexity**. Here’s a quick reference:  \n\n| Complexity | Name | Example |\n|------------|-----------------|--------------------------------|\n| O(1) | Constant Time | Accessing an array index |\n| O(log n) | Logarithmic Time | Binary search |\n| O(n) | Linear Time | Iterating through an array |\n| O(n log n) | Linearithmic Time | Merge Sort, Quick Sort |\n| O(n²) | Quadratic Time | Nested loops (e.g., Bubble Sort) |\n| O(2ⁿ) | Exponential Time | Fibonacci recursion |\n| O(n!) | Factorial Time | Traveling Salesman Problem |\n\n---\n\n## 🛠️ Example: Implementing a Sorting Algorithm  \n\nHere’s an implementation of **Merge Sort**, an O(n log n) sorting algorithm:  \n\n```python\ndef merge_sort(arr):\n    if len(arr) \u003c= 1:\n        return arr\n    \n    mid = len(arr) // 2\n    left_half = merge_sort(arr[:mid])\n    right_half = merge_sort(arr[mid:])\n    \n    return merge(left_half, right_half)\n\ndef merge(left, right):\n    sorted_arr = []\n    i = j = 0\n    \n    while i \u003c len(left) and j \u003c len(right):\n        if left[i] \u003c right[j]:\n            sorted_arr.append(left[i])\n            i += 1\n        else:\n            sorted_arr.append(right[j])\n            j += 1\n    \n    sorted_arr.extend(left[i:])\n    sorted_arr.extend(right[j:])\n    \n    return sorted_arr\n\n# Example Usage\narr = [5, 3, 8, 6, 2, 7, 4, 1]\nprint(\"Sorted Array:\", merge_sort(arr))\n```\n\nOutput:  \n```\nSorted Array: [1, 2, 3, 4, 5, 6, 7, 8]\n```\n\n---\n\n## 🔍 Topics Covered  \n\n### 📌 **Data Structures**  \n- **Arrays \u0026 Strings**  \n- **Linked Lists** (Singly, Doubly, Circular)  \n- **Stacks \u0026 Queues**  \n- **Hash Tables \u0026 Hash Functions**  \n- **Trees \u0026 Binary Search Trees (BSTs)**  \n- **Heaps \u0026 Priority Queues**  \n- **Graphs (Adjacency List \u0026 Matrix)**  \n\n### 🔢 **Algorithms**  \n- **Sorting Algorithms:** Bubble, Selection, Insertion, Merge, Quick, Heap Sort  \n- **Searching Algorithms:** Linear Search, Binary Search  \n- **Graph Algorithms:** BFS, DFS, Dijkstra’s Algorithm  \n- **Dynamic Programming:** Fibonacci, Knapsack Problem  \n- **Divide \u0026 Conquer:** Merge Sort, Quick Sort  \n- **Greedy Algorithms:** Huffman Coding, Activity Selection  \n- **Backtracking:** N-Queens, Sudoku Solver  \n\n---\n\n## 🏆 Problem-Solving Challenges  \n\n📌 The repository includes **real-world problems** with optimal solutions. Examples:  \n\n1️⃣ Find the **two numbers** in an array that sum up to a target (`O(n)`)  \n2️⃣ Detect a **cycle** in a linked list (`O(n)`)  \n3️⃣ Find the **lowest common ancestor (LCA)** in a BST (`O(log n)`)  \n4️⃣ Implement a **LRU Cache** using a HashMap \u0026 Doubly Linked List (`O(1)`)  \n5️⃣ Solve the **N-Queens problem** using Backtracking (`O(N!)`)  \n\n---\n\n## 🔥 Sorting Algorithm Visualizations  \n\nThe repository includes **sorting visualizations** for algorithms like:  \n\n| Algorithm | Time Complexity | Visualization |\n|-----------|----------------|---------------|\n| Bubble Sort | O(n²) | ![Bubble Sort](https://upload.wikimedia.org/wikipedia/commons/c/c8/Bubble-sort-example-300px.gif) |\n| Merge Sort | O(n log n) | ![Merge Sort](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Merge_sort_algorithm_diagram.svg/600px-Merge_sort_algorithm_diagram.svg.png) |\n| Quick Sort | O(n log n) | ![Quick Sort](https://upload.wikimedia.org/wikipedia/commons/6/6a/Sorting_quicksort_anim.gif) |\n\n---\n\n## ⚡ How to Run the Code  \n\n### 1️⃣ Clone the Repository  \n```bash\ngit clone https://github.com/saadsalmanakram/DS-BigO-Complexity.git\ncd DS-BigO-Complexity\n```\n\n### 2️⃣ Install Dependencies  \n```bash\npip install -r requirements.txt\n```\n\n### 3️⃣ Run Example Scripts  \n```bash\npython algorithms/merge_sort.py\npython data_structures/linked_list.py\n```\n\n---\n\n## 🏆 Contributing  \n\nContributions are welcome! 🚀  \n\n🔹 **Fork** the repository  \n🔹 Create a new branch (`git checkout -b feature-name`)  \n🔹 Commit changes (`git commit -m \"Added new sorting algorithm\"`)  \n🔹 Push to your branch (`git push origin feature-name`)  \n🔹 Open a pull request  \n\n---\n\n## 📜 License  \n\nThis project is licensed under the **MIT License** – feel free to use, modify, and share the code.  \n\n---\n\n## 🔗 Resources \u0026 References  \n\n- [Big-O Complexity Cheat Sheet](https://www.bigocheatsheet.com/)  \n- [MIT Algorithms Course](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/)  \n- [CLRS: Introduction to Algorithms](https://en.wikipedia.org/wiki/Introduction_to_Algorithms)  \n\n---\n\n## 📬 Contact  \n\nFor queries or collaboration, reach out via:  \n\n📧 **Email:** saadsalmanakram1@gmail.com  \n🌐 **GitHub:** [SaadSalmanAkram](https://github.com/saadsalmanakram)  \n💼 **LinkedIn:** [Saad Salman Akram](https://www.linkedin.com/in/saadsalmanakram/)  \n\n---\n\n⚡ **Master Data Structures \u0026 Algorithms with Confidence!** ⚡  \n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadsalmanakram%2Fds-bigo-complexity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadsalmanakram%2Fds-bigo-complexity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadsalmanakram%2Fds-bigo-complexity/lists"}