{"id":26489970,"url":"https://github.com/taharachedi/custom_stack_library-cpp","last_synced_at":"2025-03-20T07:53:42.899Z","repository":{"id":280964036,"uuid":"943757544","full_name":"taharachedi/Custom_Stack_Library-CPP","owner":"taharachedi","description":"This stack isn't the usual LIFO stack; it's more like a linked list with unique behavior. I built it to learn object-oriented programming and master stack manipulation.","archived":false,"fork":false,"pushed_at":"2025-03-06T08:15:30.000Z","size":850,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T09:34:03.620Z","etag":null,"topics":["data-structures","stack"],"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/taharachedi.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":"2025-03-06T08:10:01.000Z","updated_at":"2025-03-06T08:15:39.000Z","dependencies_parsed_at":"2025-03-06T09:34:04.770Z","dependency_job_id":"b6c061e1-c447-4bf8-8bfb-1208a47cc88d","html_url":"https://github.com/taharachedi/Custom_Stack_Library-CPP","commit_stats":null,"previous_names":["taharachedi/custom_stack_library-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taharachedi%2FCustom_Stack_Library-CPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taharachedi%2FCustom_Stack_Library-CPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taharachedi%2FCustom_Stack_Library-CPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taharachedi%2FCustom_Stack_Library-CPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taharachedi","download_url":"https://codeload.github.com/taharachedi/Custom_Stack_Library-CPP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244574743,"owners_count":20474818,"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","stack"],"created_at":"2025-03-20T07:53:42.298Z","updated_at":"2025-03-20T07:53:42.890Z","avatar_url":"https://github.com/taharachedi.png","language":"C++","readme":"# 📌 Stack Implementation (clsMyStack) ⚡\n\n\u003e **A C++ template-based stack implementation using a queue (clsMyQueue) built on top of a doubly linked list, supporting basic stack operations and extensions for advanced usage. 🚀**\n\n---\n\n## 🌟 Project Overview\n\nThe `clsMyStack` class is a **generic stack** implementation in C++ using the **clsMyQueue** class, which itself is based on a doubly linked list (`clsDblLinkedList`). This structure ensures efficient memory management and stack operations like **push**, **pop**, and **peek** while offering extended functionalities.\n\n### 🔹 Core Functionalities:\n- **Push** elements to the top of the stack 🔄\n- **Pop** elements from the top ❌\n- **Access Top \u0026 Bottom** elements directly 🔍\n- **Check Stack Size \u0026 Emptiness** 📏\n- **Reverse** stack elements 🔄\n- **Modify \u0026 Insert** elements within the stack ✏️\n- **Clear** the entire stack with one function call ✨\n\nThis stack implementation is **generic**, meaning it can handle any data type using C++ templates.\n\n---\n\n## ✨ Features\n\n### 🔹 Basic Stack Operations\n- **`Push(Value)`**: Adds an element to the top of the stack.\n- **`Pop()`**: Removes the top element of the stack.\n- **`Top()`**: Retrieves the top element of the stack.\n- **`Bottom()`**: Retrieves the bottom element of the stack.\n- **`Size()`**: Returns the number of elements in the stack.\n- **`IsEmpty()`**: Checks if the stack is empty.\n- **`Print()`**: Displays the stack elements.\n\n### 🔹 Extended Functionalities\n- **`GetItem(Index)`**: Retrieves the value of an element at a specific index.\n- **`Reverse()`**: Reverses the order of stack elements.\n- **`UpdateItem(Index, NewValue)`**: Updates the value of an element at a given index.\n- **`InsertAfter(Index, Value)`**: Inserts an element after a specific index.\n- **`InsertAtFront(Value)`**: Inserts an element at the top of the stack.\n- **`InsertAtBack(Value)`**: Inserts an element at the bottom of the stack.\n- **`Clear()`**: Removes all elements from the stack.\n\n---\n\n## 🚀 How It Works\n\n### 🔹 Push \u0026 Pop\n- Elements are added using `Push(Value)` at the **top** of the stack.\n- Elements are removed using `Pop()` from the **top**.\n\n### 🔹 Accessing Elements\n- `Top()` and `Bottom()` allow **direct access** to the top and bottom elements of the stack.\n- `GetItem(Index)` retrieves an element at a given position.\n\n### 🔹 Modifications \u0026 Reversal\n- `UpdateItem(Index, NewValue)` modifies an existing value at a given index.\n- `Reverse()` swaps all element links to **reverse** the stack order.\n- `InsertAfter(Index, Value)`, `InsertAtFront(Value)`, and `InsertAtBack(Value)` allow **custom insertions**.\n\n### 🔹 Memory Management\n- The stack dynamically allocates memory for new elements.\n- `Clear()` safely removes all elements to prevent memory leaks.\n\n---\n\n## 📚 Potential Enhancements\n\n- 🏗 **Iterator Support**: Implementing iterators for STL-like traversal.\n- ⏳ **Time Complexity Optimization**: Enhancing performance for large datasets.\n- 🗃️ **Persistent Storage**: Implementing file handling for saving stack data.\n- 🚀 **Thread Safety**: Making the stack thread-safe for concurrent operations.\n\n---\n\n## ⚙️ Technologies Used\n\n- **Language**: C++\n- **Templates**: Enables the stack to store any data type.\n- **Queue-based Stack**: Leverages a queue (`clsMyQueue`) implemented with a doubly linked list.\n- **Dynamic Memory Allocation**: Uses pointers for flexible data storage.\n\n---\n\n## 🎯 Learning Outcomes\n\nThis project demonstrates:\n- ✅ **Stack operations (push, pop, top, bottom, size, empty check)**\n- ✅ **Generic programming with C++ templates**\n- ✅ **Queue-based stack implementation for dynamic storage**\n- ✅ **Efficient memory management with pointers**\n\n---\n\n## 📜 License\n\nThis project is **open-source**. Feel free to modify and enhance it! 🚀\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! If you have ideas for improvements, submit a Pull Request.\n\n---\n\n## 🏁 Ready to Explore?\n\n### 🚀 How to Run\n1. **Download** the repository.\n2. **Include** `clsMyStack.h` in your project.\n3. **Compile \u0026 Run** your C++ program with a standard compiler (e.g., `g++ main.cpp -o output`).\n4. **Test** different stack operations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaharachedi%2Fcustom_stack_library-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaharachedi%2Fcustom_stack_library-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaharachedi%2Fcustom_stack_library-cpp/lists"}