{"id":22726165,"url":"https://github.com/tinyhiker/dsa_leetcode","last_synced_at":"2025-06-17T18:35:37.665Z","repository":{"id":219016738,"uuid":"747931600","full_name":"tinyHiker/DSA_leetcode","owner":"tinyHiker","description":"This directory hold  my work on data structures and algorithms. It also holds some of my leetcode practice.","archived":false,"fork":false,"pushed_at":"2024-02-28T19:08:46.000Z","size":1443,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T23:43:45.930Z","etag":null,"topics":["array","big","bigonotation","hashmap","leetcode-python","linked-list","queue","stacks","time-complexity-analysis"],"latest_commit_sha":null,"homepage":"","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/tinyHiker.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-01-24T23:21:25.000Z","updated_at":"2024-01-25T00:42:23.000Z","dependencies_parsed_at":"2024-01-25T01:45:00.674Z","dependency_job_id":"d3549874-52e4-410d-a9bd-f15f6bbf9aad","html_url":"https://github.com/tinyHiker/DSA_leetcode","commit_stats":null,"previous_names":["tinyhiker/dsa_leetcode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tinyHiker/DSA_leetcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyHiker%2FDSA_leetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyHiker%2FDSA_leetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyHiker%2FDSA_leetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyHiker%2FDSA_leetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyHiker","download_url":"https://codeload.github.com/tinyHiker/DSA_leetcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyHiker%2FDSA_leetcode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260419418,"owners_count":23006278,"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":["array","big","bigonotation","hashmap","leetcode-python","linked-list","queue","stacks","time-complexity-analysis"],"created_at":"2024-12-10T16:15:59.643Z","updated_at":"2025-06-17T18:35:32.653Z","avatar_url":"https://github.com/tinyHiker.png","language":"Python","readme":"*Credit to TMU/Ryerson's CPS 305 course for teaching me about data structures and algorithms*\n\n*Credit to Elshad Kamriov's Udemy Course for teaching me strctures in python*\nhttps://www.udemy.com/course/data-structures-and-algorithms-bootcamp-in-python/\n![My Image](images/udemy_pic.png)\n\n# Overview of Data Structures\n\nBelow --\u003e\u003e\n\n## Linked Lists\n- **Definition**: A linear collection of data elements, where each element points to the next, forming a sequence.\n- **Key Features**:\n  - Dynamic size.\n  - Efficient insertion and deletion.\n  - Sequential access (not random).\n- **Types**:\n  - Singly linked lists.\n  - Doubly linked lists.\n- **Use Cases**: Useful for applications with frequent addition and removal of elements where memory allocation is a concern.\n![linkedlist](images/linkedlist.png)\n\n## Arrays\n- **Definition**: A collection of items stored at contiguous memory locations. \n- **Key Features**:\n  - Fixed size.\n  - Elements are of the same type.\n  - Random access of elements using indices.\n  - Efficient access and iteration.\n- **Use Cases**: When you need fast access to elements using index, and the size of the collection is known and fixed.\n\n\n## Queues\n- **Definition**: A collection of entities that are maintained in a sequence and can be modified by adding at one end (the rear) and removing from the other end (the front).\n- **Key Features**:\n  - FIFO (First In, First Out) structure.\n  - Enqueue (add) operations at the rear.\n  - Dequeue (remove) operations at the front.\n- **Use Cases**: Handling of data where the order of operations is essential, like task scheduling.\n\n## Stacks\n- **Definition**: A collection of elements with two main operations: push, which adds to the collection, and pop, which removes the most recently added element.\n- **Key Features**:\n  - LIFO (Last In, First Out) structure.\n  - Push and pop operations.\n- **Use Cases**: Useful in situations where a reverse order of operations is required, like undo mechanisms in text editors.\n![stacks](images/stacks.png)\n\n## Trees\n- **Definition**: A hierarchical data structure with a root value and subtrees of children, each with a parent node.\n- **Key Features**:\n  - Non-linear.\n  - Each node can have any number of children.\n  - Trees are recursive data structures.\n- **Types**:\n  - Binary Trees.\n  - AVL Trees.\n  - Red-Black Trees, etc.\n- **Use Cases**: Representing hierarchical data, like file systems, and for efficient searching and sorting.\n\n## Hashmaps (Hash Tables)\n- **Definition**: A data structure that implements an associative array abstract data type, a structure that can map keys to values.\n- **Key Features**:\n  - Key-value pairs.\n  - Efficient insertion, deletion, and lookup.\n  - Hash function to compute index for a key.\n- **Use Cases**: When you need to access elements by a key, and efficiency is a concern. Common in database indexing.\n\n![hashmap](images/hashmap.png)\nThis summary provides a basic understanding of each data structure, their key characteristics, and typical use cases.\n\n\n# Tree Terminology and Types of Binary Trees\n\n## Tree Terminology\n\n- **Root**: The top node without a parent.\n- **Edge**: A link between a parent and a child node.\n- **Leaf**: A node which does not have children.\n- **Sibling**: Children of the same parent.\n- **Ancestor**: A parent, grandparent, great-grandparent, etc., of a node.\n- **Depth of a Node**: The length of the path from the root to the node, measured in the number of edges.\n- **Height of a Node**: The length of the path from the node to the deepest node connected to it. This length is measured by the number of edges.\n- **Depth of the Tree**: The depth of the root node, which is always zero.\n- **Height of the Tree**: The height of the root node.\n\n## Types of Binary Trees\n\n### Full Binary Tree\n- Each node has either 0 or 2 children. No node has exactly 1 child.\n\n### Perfect Binary Tree\n- Every node other than leaf nodes has exactly two children.\n- All leaf nodes are at the same level.\n- The tree has exactly 2^(h+1) - 1 nodes, where `h` is the height of the tree.\n- The number of leaf nodes is (n+1)/2 for a tree with `n` nodes.\n\n### Complete Binary Tree\n- Every level, except possibly the last, is completely filled.\n- If the last level is not filled, nodes are as far left as possible.\n\n### Balanced Binary Tree\n- A tree where all leaf nodes are at the same distance from the root.\n\n## Deepest Node in a Binary Tree\n- The deepest node is the last node reached in a level order traversal.\n\n## Tree Search Techniques\n\n### Depth First Search (DFS)\n1. **Preorder Traversal**: Visit the root node, then the left subtree, followed by the right subtree.\n2. **Inorder Traversal**: Visit the left subtree, then the root node, and finally the right subtree.\n3. **Postorder Traversal**: Visit the left subtree, the right subtree, and then the root node.\n\n### Breadth First Search (BFS)\n- **Level Order Traversal**: Visit each level from left to right.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyhiker%2Fdsa_leetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyhiker%2Fdsa_leetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyhiker%2Fdsa_leetcode/lists"}