{"id":17893983,"url":"https://github.com/grantgasser/udacity-data-structures-algorithms","last_synced_at":"2025-08-15T03:32:19.804Z","repository":{"id":129537754,"uuid":"199504970","full_name":"grantgasser/udacity-data-structures-algorithms","owner":"grantgasser","description":"These are exercises done as part of the Udacity Data Structures and Algorithms in Python course","archived":false,"fork":false,"pushed_at":"2023-02-28T19:34:29.000Z","size":21,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T16:59:52.164Z","etag":null,"topics":["algorithms","bst","graph","hashing","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/grantgasser.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":"2019-07-29T18:16:47.000Z","updated_at":"2024-03-11T03:31:29.000Z","dependencies_parsed_at":"2023-05-06T09:32:12.137Z","dependency_job_id":null,"html_url":"https://github.com/grantgasser/udacity-data-structures-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/grantgasser%2Fudacity-data-structures-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantgasser%2Fudacity-data-structures-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantgasser%2Fudacity-data-structures-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantgasser%2Fudacity-data-structures-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grantgasser","download_url":"https://codeload.github.com/grantgasser/udacity-data-structures-algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229890115,"owners_count":18140043,"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","bst","graph","hashing","python"],"created_at":"2024-10-28T14:58:41.396Z","updated_at":"2024-12-16T00:11:28.389Z","avatar_url":"https://github.com/grantgasser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Data Structures and Algorithms\nThese are exercises done as part of the Udacity Data Structures and Algorithms in Python course\n\n## Queues (queue.py)\n* A queue is a first in first out (FIFO) data structure\n* One can enqueue (push) to the end of the queue\n* One can dequeue (pop) from the front of the queue\n* Push and Pop in O(1)\n* Can implement a Queue object using a Python list\n* Could also use a Python deque, which allows enqueueing and dequeueing from both ends - `from collections import deque`\n\n## Hashing (hashing.py)\n* Can use Python dictionary as hashtable/hashmap\n* Create HashTable object using Python list\n* Hashing strings, particularly the first two letters of string\n* Bucket size 10,000\n* Load factor is % of table filled\n* Hash value = (ASCII Value of First Letter * 100) + ASCII Value of Second Letter\n* O(1) Lookup\n\n## Binary Search (binary_search.py)\n* Iterative binary search on Python list\n* Assumes data is sorted\n* O(log n) search\n\n## Trees (A type of graph)\n* Connected graphs, acyclic, directed\n* Root (top node, first node)\n* Parent and child\n* Leaf is a bottom node\n* If node doesn't point to other node, usually points to Null (None)\n* Traversing is done recursively\n\n## Binary Tree (binarytree.py)\n* Each parent has at most 2 children\n* Height is log n\n* Implement preorder (LRN) search and print\n* Comprised of Node objects that contain the value and left, right child pointers\n\n## Binary Search Tree (bst.py)\n* Left child \u003c parent\n* Right child \u003e parent\n* Search is O(log n), the height of the tree\n* In-order traversal is sorted order\n* Can degrade to looking like linked list =\u003e O(n) search in worst case\n* Enter self-balancing trees (AVL, Red-black)\n\n## Graph (graph.py)\n* Node class contains value and list of edges connected to that node\n* Edge class contains value, references to node from and node to\n* Graph class contains list of nodes and list of edges\n* Insert node is simple\n* Insert edge is a little more complicated.\n* Get representation of edge list, adjacency list, and adjacency matrix\n\n## Graph (graph2.py)\n* Here I implemented DFS (recursive) and BFS (iterative)\n* The rest of the code was written by Udacity\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantgasser%2Fudacity-data-structures-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantgasser%2Fudacity-data-structures-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantgasser%2Fudacity-data-structures-algorithms/lists"}