{"id":31955711,"url":"https://github.com/theronwolcott/data-structure-binary-patricia-trie-main","last_synced_at":"2025-10-14T14:27:24.345Z","repository":{"id":310708580,"uuid":"776218529","full_name":"theronwolcott/data-structure-binary-patricia-trie-main","owner":"theronwolcott","description":"Binary Patricia Trie for efficient binary string storage and management. Features include insertion, deletion, search, in-order traversal, longest string retrieval, and size tracking with a compressed, memory-efficient node structure.","archived":false,"fork":false,"pushed_at":"2025-08-19T18:03:16.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-19T20:24:38.481Z","etag":null,"topics":["data-structures","java","tries"],"latest_commit_sha":null,"homepage":"","language":"Java","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/theronwolcott.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,"zenodo":null}},"created_at":"2024-03-22T23:25:34.000Z","updated_at":"2025-08-19T18:03:19.000Z","dependencies_parsed_at":"2025-08-19T20:25:04.243Z","dependency_job_id":"d5f655ff-a1b6-4279-b0e6-28b1b629a70d","html_url":"https://github.com/theronwolcott/data-structure-binary-patricia-trie-main","commit_stats":null,"previous_names":["theronwolcott/data-structure-binary-patricia-trie-main"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/theronwolcott/data-structure-binary-patricia-trie-main","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theronwolcott%2Fdata-structure-binary-patricia-trie-main","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theronwolcott%2Fdata-structure-binary-patricia-trie-main/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theronwolcott%2Fdata-structure-binary-patricia-trie-main/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theronwolcott%2Fdata-structure-binary-patricia-trie-main/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theronwolcott","download_url":"https://codeload.github.com/theronwolcott/data-structure-binary-patricia-trie-main/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theronwolcott%2Fdata-structure-binary-patricia-trie-main/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019119,"owners_count":26086680,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","java","tries"],"created_at":"2025-10-14T14:27:22.038Z","updated_at":"2025-10-14T14:27:24.339Z","avatar_url":"https://github.com/theronwolcott.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binary Patricia Trie\n\n## Overview\nThis project implements a **Binary Patricia Trie** (also known as a Binary Prefix Tree), a highly efficient data structure for storing and managing binary strings. The primary goal of the project is to implement core operations such as insertion, deletion, search, and in-order traversal, and to maintain an efficient representation of binary strings in a trie-like structure.\n\n## Features\n- **Insertion**: Efficiently inserts binary strings into the trie.\n- **Deletion**: Supports the removal of binary strings from the trie, ensuring the integrity of the data structure.\n- **Lookup/Search**: Allows for quick search and retrieval of binary strings.\n- **In-order Traversal**: Traverses the trie in lexicographical order, listing all stored keys.\n- **Accessor Methods**: Provides methods to get the longest string in the trie, the size of the trie, and checks for an empty trie.\n- **Efficient Memory Usage**: Uses a space-efficient structure, storing only necessary data at each node.\n\n## Key Concepts\n\n### Patricia Trie\nA Patricia Trie (Practical Algorithm to Retrieve Information Coded in Alphanumeric) is a compressed version of a regular trie. Unlike a standard trie, where each node typically represents a single character of a key, a Patricia Trie uses paths (representing sequences of characters) and splits nodes where necessary, offering space and time efficiency.\n\n### Binary Patricia Trie\nIn this implementation, the trie stores **binary strings** (strings consisting of only `0`s and `1`s). It follows the same principles as a regular Patricia Trie but tailored specifically for binary data.\n\n### Operations\n\n- **Insert**: Adds a binary string to the trie, creating or adjusting nodes as necessary to maintain the trie structure.\n- **Delete**: Removes a binary string from the trie and re-adjusts the structure to maintain the correct state.\n- **Search**: Finds if a given binary string exists in the trie.\n- **In-order Traversal**: Lists the binary strings stored in the trie in lexicographical (sorted) order.\n- **Longest String**: Retrieves the longest string present in the trie.\n- **Size**: Returns the number of keys (strings) currently stored in the trie.\n- **Empty Check**: Returns `true` if the trie contains no strings.\n\n## Data Structure Design\n\nThe trie is implemented using **nodes** that contain:\n- A **bit flag** indicating whether the node is a leaf or a splitter (internal) node.\n- A **substring** of the key if the node is a splitter, or the full key if it is a leaf.\n- **Child nodes**, representing further binary strings diverging from the current node.\n\n### Node Representation\nThe binary strings are represented with splits at common prefixes, ensuring a compact representation without redundancy. Each internal node (splitter node) handles a common prefix, and leaf nodes store actual strings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheronwolcott%2Fdata-structure-binary-patricia-trie-main","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheronwolcott%2Fdata-structure-binary-patricia-trie-main","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheronwolcott%2Fdata-structure-binary-patricia-trie-main/lists"}