{"id":16471781,"url":"https://github.com/katiechurchwell/data-structures","last_synced_at":"2025-02-28T03:20:56.643Z","repository":{"id":250180503,"uuid":"533005775","full_name":"katiechurchwell/data-structures","owner":"katiechurchwell","description":"Demystifying Data Structures Notes by Brook Riggio, 2022 CascadiaJS.","archived":false,"fork":false,"pushed_at":"2022-09-06T16:23:04.000Z","size":1405,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T23:34:46.875Z","etag":null,"topics":["data-structures","notes"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/katiechurchwell.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":"2022-09-05T17:55:18.000Z","updated_at":"2022-09-05T18:19:45.000Z","dependencies_parsed_at":"2024-07-25T18:22:47.248Z","dependency_job_id":null,"html_url":"https://github.com/katiechurchwell/data-structures","commit_stats":null,"previous_names":["katiechurchwell/data-structures"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katiechurchwell%2Fdata-structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katiechurchwell%2Fdata-structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katiechurchwell%2Fdata-structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katiechurchwell%2Fdata-structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katiechurchwell","download_url":"https://codeload.github.com/katiechurchwell/data-structures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241094241,"owners_count":19908647,"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":["data-structures","notes"],"created_at":"2024-10-11T12:14:40.792Z","updated_at":"2025-02-28T03:20:56.605Z","avatar_url":"https://github.com/katiechurchwell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demystifying Data Structures Notes by Brook Riggio, 2022 CascadiaJS\n\n## Intro\n\n![abstraction layers](./images/abstraction-layers.jpg)\n\n- Everytime you create an object, you introduce a layer of abstraction.\n- You can swap out any layer.\n- Hiding details below, usage API looking up\n\n![computational cycle](./images/cycle.jpg)\n\n\u003e Computational thinking - formulating a problem and expressing it's solution. Process.\n\n- modeling a problem : finding the right details to focus on.\n- Computing is instructions and data \u003e processed \u003e result\n\n- Abstractions map to specific problems \u003e make it simpler\n\n## Abstract Data Structures\n\n- Array\n- [Linked List](https://my.mindnode.com/3qHEkZSjxuNFsVQvrN3Prm6smDzeLKcKA8P8sZF3)\n- [Stack](https://my.mindnode.com/9S8sTq6q68R3S9ZsBMqqZynyMpS6HRVGR7jhqjzk)\n- [Queue](https://my.mindnode.com/Ggp2kJzx8z96zAnfaSJGNGwH4tpVCpLsu3PZjF8L)\n- [Binary Tree](https://my.mindnode.com/ByphRGZUs9yfqksaLzMqDVsmsTeBaJ2W4ioq1p5p)\n  - K-Ary Tree\n  - Graph\n- [Hashmap](https://my.mindnode.com/ZwYyemgphkpraukAr2xHunfbKhR1bxd7XLL1qtzn)\n\n## Data\n\n- RAM\n  - addressable memory, like a spreadsheet; columns \u0026 rows.\n  - use additional memory for pointers. Linked list.\n  - each cell is a node.\n\n## Linked List\n\n- Single linked list you know next but not previous (doubly for both).\n- Value and next.\n- A collection of nodes where each node holds a value and a pointer to the next node.\n- Use cases: version history, carousel/slideshow, API pagination, blockchains.\n- Traversed the list, traversal.\n- Primary operations: add, traverse, size.\n\nSide note: while is preferable over a for loop when length is unknown.\n\nO notation:\n\n- O of 1 = constant time; don't need to know the length\n- 0(n) search\n\n## Stack\n\n- Last in, first out. Pushing and popping one value at a time.\n- Examples: browser history, backtracking apps, undo/redo.\n- A stack is a collection of nodes where each node holds a value accessible in LIFO order.\n\n## Queue\n\n- FIFO\n- JavaScript is event driven programming.\n- [What the heck is the event loop anyway? | Philip Roberts | JSConf EU](https://www.youtube.com/watch?v=8aGhZQkoFbQ)\n- Messaging services:\n  - Amazon SQS\n  - RabbitMQ\n- A queue is a collection of nodes where each node holds a value accessible in FIFO order.\n- O(1) enqueue and dequeue\n- Cannot traverse, no random access.\n- Priority queue - assign priority to nodes.\n\n## Array\n\n- Ammortizes cost with add, memory offsets.\n- Proportionally allocate more RAM room.\n- JavaScript uses dynamic arrays.\n- Buffer overflow attack. punch through at the end of array and inject code.\n- Sortable.\n- A collection of values indexed from an initial point in memory individually accessible at an offset.\n- Sequential access (for-loop), efficient.\n- Reserves memory as it grows: 0(2n) space.\n  - A linked list would be 0(1) for inserting in the middle\n- Merge sort, quick sort and insert sort.\n- Binary search algorithm.\n\n## Binary Tree\n\n- Analogies: [reverse polish notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation), dichotomous key, branching river.\n- Examples: AI/ML decision tree, huffman coding (.jpeg compression), etc.\n- \"Binary search tree\" and \"B trees\" are different than a binary tree.\n- Traversing: breadth or width first.\n- Full, perfect, complete; root, branch, leaf, height.\n- Strengths: O(log n) search, elegant recursion, simplicity of interface\n\n## Hash Maps\n\n- Hashing (used bcrypt in past).\n- Key values.\n- Analogies: dictionary, GPS coordinates, upc codes, license plates, ssn\n- Objects in objects.\n- A collection of values labeled with infinite key possibilities stored in a finite amount of memory.\n- o(1) time\n\n## Further Research\n\n- Gayle Laakmann McDowell videos\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatiechurchwell%2Fdata-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatiechurchwell%2Fdata-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatiechurchwell%2Fdata-structures/lists"}