{"id":27784530,"url":"https://github.com/erfan22r/datastructuresproject-antcity","last_synced_at":"2025-04-30T14:28:28.518Z","repository":{"id":290062077,"uuid":"973259867","full_name":"Erfan22R/DataStructuresProject-AntCity","owner":"Erfan22R","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-26T16:00:46.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T14:28:28.335Z","etag":null,"topics":["algorithms","cpp","data-structures","decoding","encoding"],"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/Erfan22R.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":"2025-04-26T15:57:43.000Z","updated_at":"2025-04-26T16:09:51.000Z","dependencies_parsed_at":"2025-04-26T16:40:00.224Z","dependency_job_id":"66e32421-4f69-4718-9ba3-1ea5107d9a07","html_url":"https://github.com/Erfan22R/DataStructuresProject-AntCity","commit_stats":null,"previous_names":["erfan22r/datastructuresproject-antcity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfan22R%2FDataStructuresProject-AntCity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfan22R%2FDataStructuresProject-AntCity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfan22R%2FDataStructuresProject-AntCity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfan22R%2FDataStructuresProject-AntCity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erfan22R","download_url":"https://codeload.github.com/Erfan22R/DataStructuresProject-AntCity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721183,"owners_count":21632777,"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","cpp","data-structures","decoding","encoding"],"created_at":"2025-04-30T14:28:26.037Z","updated_at":"2025-04-30T14:28:28.512Z","avatar_url":"https://github.com/Erfan22R.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataStructuresProject-AntCity\n\nThis project implements an **encoding** and **decoding** system for managing the birth process of ants in a fictional city of ants.  \nIt was developed as a **full project for the Data Structures course**, not just a simple exercise.\n\n## Problem Description\n\nIn the city of ants, each ant's body structure is represented by a string of English letters (similar to DNA in humans). There are two types of ants:\n- **Queens** (mothers)\n- **Workers** (fathers)\n\nDuring the reproduction period:\n- If a **substring** of a worker matches a **prefix** of a queen, a new baby ant is born with that substring as its body string.\n- Newborn ants, along with some **foreign ants** (intruders that do not match any parent), form a queue to enter the city.\n\nThe **city gatekeeper** has two tasks:\n1. Identify and remove foreign ants from the queue.\n2. Save the order of the newborn ants efficiently in a file.\n\nThe main challenge is not just to correctly filter the ants, but also to **minimize the size** of the saved file (`order`).\n\n## Project Components\n\n- `encoder.cpp`:\n  - Reads the list of queens and workers from the file `parents.txt`.\n  - Reads the input queue of ants from the standard input.\n  - Filters out the foreign ants.\n  - Saves the sequence of newborn ants efficiently into the file `order`.\n\n- `decoder.cpp`:\n  - Reads `parents.txt` and `order`.\n  - Reconstructs and outputs the exact sequence of the newborn ants to the standard output.\n\n## Input and Output Details\n\n- **`parents.txt`**:\n  - First line: number of queens and workers.\n  - Following lines: first the list of queens, then the list of workers (each on a separate line).\n\n- **Encoder Standard Input**:\n  - First line: the length of the input queue.\n  - Next lines: the body string of each ant.\n\n- **`order` File**:\n  - Can have any format.\n  - The content of this file is not evaluated directly; only the correctness and size minimization are important.\n\n- **Decoder Standard Output**:\n  - Prints the newborn ants in the exact original order, each on a separate line.\n\n## Requirements\n\n- C++11 or later\n- A standard C++ compiler (e.g., `g++`, `clang++`)\n\n## Notes\n\n- This project was completed as a main project for the Data Structures course.\n- The goal is to ensure **algorithmic correctness** while also **optimizing storage size** for the output file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfan22r%2Fdatastructuresproject-antcity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferfan22r%2Fdatastructuresproject-antcity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfan22r%2Fdatastructuresproject-antcity/lists"}