{"id":20570565,"url":"https://github.com/yvesemmanuel/datastructures_algorithms","last_synced_at":"2025-03-06T09:50:53.447Z","repository":{"id":133265323,"uuid":"364058406","full_name":"yvesemmanuel/datastructures_algorithms","owner":"yvesemmanuel","description":"Implements artifacts studied at Algorithms and Data Structure classes.","archived":false,"fork":false,"pushed_at":"2023-10-25T23:38:06.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T21:12:01.268Z","etag":null,"topics":["algorithms","complexity-analysis","cpp","data-structures","oop"],"latest_commit_sha":null,"homepage":"","language":"C++","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/yvesemmanuel.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}},"created_at":"2021-05-03T20:53:44.000Z","updated_at":"2023-10-25T23:43:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f65a8213-5034-4d5d-b7b0-8339a2fd2e40","html_url":"https://github.com/yvesemmanuel/datastructures_algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvesemmanuel%2Fdatastructures_algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvesemmanuel%2Fdatastructures_algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvesemmanuel%2Fdatastructures_algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yvesemmanuel%2Fdatastructures_algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yvesemmanuel","download_url":"https://codeload.github.com/yvesemmanuel/datastructures_algorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242187614,"owners_count":20086217,"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":["algorithms","complexity-analysis","cpp","data-structures","oop"],"created_at":"2024-11-16T05:13:36.932Z","updated_at":"2025-03-06T09:50:53.417Z","avatar_url":"https://github.com/yvesemmanuel.png","language":"C++","readme":"# Algorithms and Data Structures Description\n\n## [Data Structures](https://github.com/yvesemmanuel/datastructures_algorithms/tree/main/data_structures)\n### [Array-Based List](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/array-based%20list.cpp)\n- ± Predefined maximum size (alternative: dynamic arrays)\n- *+* No extra space with pointers (links)\n- − Space is consumed by unused positions\n- **Time Complexity** (worst and average case): **Access - θ(*1*)** | **Search - θ(*n*)** | **Insertion - θ(*n*)** | **Deletion - θ(*n*)**.\n\n### [Singly Linked List](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/singly%20linked%20list.cpp)\n- *+* No predefined maximum size\n- *+* No extra space for inaccessible elements\n- − Space is consumed by pointers (links)\n- **Time Complexity** (worst and average case): **Access - θ(*n*)** | **Search - θ(*n*)** | **Insertion - θ(*1*)** | **Deletion - θ(*1*)**.\n\n### [Array-Based Queue](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/array-based%20queue.cpp)\n- Policy: FIFO = first-in, first-out\n- The first element added to the queue will be the first to be removed.\n\n### [Array-Based Stack](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/array-based%20stack.cpp) and [Linked Stack](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/linked%20stack.cpp)\n- Policy: LIFO = last-in, first-out\n- The last element added to the stack will be the first to be removed.\n\n### [Graph](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/adjacency-matrix%20based%20graph.cpp)\n- A graph is a collection of nodes (vertices) connected by edges where |V| != 0.\n- An adjacency matrix is recommended for a dense graph, and an adjacency list is recommended for a sparse graph.\n- As an adjacency matrix, its time efficiency (graph traversal) is **Θ(|V|²)**, and as an adjacency list, its time efficiency is **Θ(|V|+|E|)**.\n\n#### Graph Traversals\n- DFS: Depth-first search starts at a selected arbitrary node as the root node in the graph and explores as far as possible along each branch before backtracking.\n- BFS: Breadth-first search starts at a selected arbitrary node as the root node in the graph and explores all neighboring nodes at the present depth before moving to nodes at the next depth level.\n- Topological Sorting: For a directed acyclic graph (DAG), topological sorting is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering.\n\n### [Binary Search Tree (BST)](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/BST%20based%20dictionary.cpp)\n- A binary search tree (BST) is an ordered binary tree where each internal vertex has no more than two children.\n- **Time Complexity** (average case): **Access - θ(*log n*)** | **Search - θ(*log n*)** | **Insertion - θ(*log n*)** | **Deletion - θ(*log n*)**.\n- **Time Complexity** (worst case): **Access - θ(*n*)** | **Search - θ(*n*)** | **Insertion - θ(*n*)** | **Deletion - θ(*n*)**.\n\n### [AVL Tree](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/data_structures/AVL%20tree.cpp)\n- The balance factor of every node is either -1, 0, or 1.\n- The difference between the heights of the left and right subtrees.\n- The height of an empty tree is -1.\n- An AVL tree is a self-balancing binary search tree.\n- **Rotation** is a local transformation to rebalance the tree.\n- **Time Complexity** (average and worst case): **Access - θ(*log n*)** | **Search - θ(*log n*)** | **Insertion - θ(*log n*)** | **Deletion - θ(*log n*)**.\n\n## [Algorithms](https://github.com/yvesemmanuel/datastructures_algorithms/tree/main/algorithms)\nConsider the worst case for all time and space complexities.\n\n### [Sorting](https://github.com/yvesemmanuel/datastructures_algorithms/tree/main/algorithms/sorting)\n#### [Selection Sort](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/algorithms/sorting/selection%20sort%20(brute%20force).cpp)\n- An in-place comparison sorting algorithm.\n- **Time Complexity**: **O(*n²*)**.\n- **Space Complexity**: **O(*1*)**.\n- **Design Strategy**: Brute force.\n\n#### [Bubble Sort](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/algorithms/sorting/bubble%20sort.cpp)\n- A simple sorting algorithm that repeatedly steps through the list, comparing and swapping adjacent elements if they are in the wrong order.\n- **Time Complexity**: **O(*n²*)**.\n- **Space Complexity**: **O(*1*)**.\n- Stable.\n\n#### [Insertion Sort](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/algorithms/sorting/insertion%20sort%20(decrease-and-conquer).cpp)\n- A simple sorting algorithm that builds the final sorted array (or list) one item at a time.\n- **Time Complexity**: **O(*n²*)** in the worst case but more efficient in practice than other quadratic algorithms.\n- **Space Complexity**: **O(*1*)**.\n- Stable.\n- **Design Strategy**: Decrease-and-conquer.\n\n#### [Merge Sort](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/algorithms/sorting/merge%20sort.cpp)\n- A divide-and-conquer algorithm that divides the unsorted list into n sublists, repeatedly merging them to produce sorted sublists until there is only one sublist remaining.\n- **Time Complexity**: **O(*nlog n*)**.\n- **Space Complexity**: **O(*n*)**.\n- Not in-place.\n- Stable.\n- **Design Strategy**: Divide-and-conquer.\n\n#### [Quick Sort](https://github.com/yvesemmanuel/datastructures_algorithms/blob/main/algorithms/sorting/quick%20sort.cpp)\n- A divide-and-conquer algorithm that selects a pivot element from the array and partitions the other elements into two sub-arrays, according to whether they are less than or greater than the pivot.\n- **Time Complexity**: **O(*n²*)** in the worst case but **Ω(*nlog n*)** in the best\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvesemmanuel%2Fdatastructures_algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyvesemmanuel%2Fdatastructures_algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyvesemmanuel%2Fdatastructures_algorithms/lists"}