{"id":20550743,"url":"https://github.com/wildandart/doublylinkedlist","last_synced_at":"2026-02-02T17:03:55.838Z","repository":{"id":253913742,"uuid":"844676480","full_name":"WildandArt/DoublyLinkedList","owner":"WildandArt","description":"Doubly Linked List with Deque Functionality: A TDD-driven implementation of a doubly linked list with deque operations for flexible and dynamic list management.","archived":false,"fork":false,"pushed_at":"2024-09-17T18:12:54.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T11:18:03.214Z","etag":null,"topics":["deque","doublylinkedlist","java","junit5","tdd","tdd-java"],"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/WildandArt.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-08-19T18:42:29.000Z","updated_at":"2024-09-17T18:03:57.000Z","dependencies_parsed_at":"2024-09-17T21:51:49.528Z","dependency_job_id":null,"html_url":"https://github.com/WildandArt/DoublyLinkedList","commit_stats":null,"previous_names":["wildandart/doublylinkedlist"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildandArt%2FDoublyLinkedList","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildandArt%2FDoublyLinkedList/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildandArt%2FDoublyLinkedList/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildandArt%2FDoublyLinkedList/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WildandArt","download_url":"https://codeload.github.com/WildandArt/DoublyLinkedList/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868766,"owners_count":21174758,"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":["deque","doublylinkedlist","java","junit5","tdd","tdd-java"],"created_at":"2024-11-16T02:27:06.894Z","updated_at":"2026-02-02T17:03:50.805Z","avatar_url":"https://github.com/WildandArt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Java](https://img.shields.io/badge/Java-17-007396?style=for-the-badge\u0026logo=java\u0026logoColor=white)\n![TDD](https://img.shields.io/badge/TDD-Test%20Driven%20Development-blue?style=for-the-badge)\n![JUnit5](https://img.shields.io/badge/JUnit-5.8.1-25A162?style=for-the-badge\u0026logo=JUnit5\u0026logoColor=white)\n\n\n# Table of Contents\n\n1. [Overview](#overview)\n2. [Prerequisites](#prerequisites)\n   - [Java 17](#java-17)\n   - [Maven](#maven)\n3. [Implementation](#implementation)\n   - [Features](#features)\n   - [Methods](#methods)\n4. [Testing](#testing)\n   - [Test-Driven Development (TDD)](#test-driven-development-tdd)\n5. [License](#license)\n\n## Overview\n\nThe `DoublyLinkedListImpl` class implements a doubly linked list in Java. This data structure supports both stack and queue operations, providing deque (double-ended queue) functionality. Each node in the list contains references to both its previous and next nodes, allowing for efficient insertion and removal from both ends.\n\n## Prerequisites\n\nTo build and run this project, you'll need to have the following software installed on your system:\n\n### Java 17\n\nYou need Java 17 to compile and run this project. To install Java 17:\n\n1. **Download the JDK**:\n   - Visit the [Oracle JDK Downloads page](https://www.oracle.com/java/technologies/javase-17-downloads.html) or the [AdoptOpenJDK page](https://adoptium.net/) to download the installer for Java 17.\n\n2. **Install the JDK**:\n   - Follow the installation instructions provided for your operating system.\n\n3. **Set Up the Java Environment**:\n   - Ensure that the `JAVA_HOME` environment variable is set to the path where Java is installed.\n   - Add the `bin` directory of the JDK to your system's `PATH` environment variable.\n\n4. **Verify the Installation**:\n   - Open a terminal or command prompt and run:\n     ```sh\n     java -version\n     ```\n   - You should see output indicating that Java 17 is installed.\n\n### Maven\n\nApache Maven is used for project management and build automation. To install Maven:\n\n1. **Download Maven**:\n   - Visit the [Apache Maven Download page](https://maven.apache.org/download.cgi) and download the binary zip or tar.gz archive.\n\n2. **Install Maven**:\n   - Extract the downloaded archive to a directory of your choice.\n\n3. **Set Up the Maven Environment**:\n   - Add the `bin` directory of the Maven installation to your system's `PATH` environment variable.\n\n4. **Verify the Installation**:\n   - Open a terminal or command prompt and run:\n     ```sh\n     mvn -version\n     ```\n   - You should see output indicating the Maven version and the Java version it is using.\n\nWith Java 17 and Maven installed, you can build and test the `DoublyLinkedListImpl` project by running Maven commands.\n\n\n# Implementation\n\n## Overview\n\nThe `DoublyLinkedListImpl` class implements a doubly linked list in Java. This data structure supports both stack and queue operations, providing deque (double-ended queue) functionality. Each node in the list contains references to both its previous and next nodes, allowing for efficient insertion and removal from both ends.\n\n## Features\n\n- **Doubly Linked List**: Each node points to both its previous and next nodes, enabling traversal in both directions.\n- **Deque Functionality**: Supports adding and removing elements from both the front and back of the list.\n\n## Methods\n\n#### \n```\npushToFront(T element)\n```\n\n**Description**: Adds a new node with the specified element to the front of the list.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time because it involves adjusting a few pointers.\n- **Space**: O(1) - No additional space is required beyond the new node.\n\n#### \n```\npushToBack(T element)\n```\n\n**Description**: Adds a new node with the specified element to the end of the list.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time because it involves adjusting a few pointers.\n- **Space**: O(1) - No additional space is required beyond the new node.\n\n#### \n```\ninsertBefore(Node\u003cT\u003e node, T data)\n```\n\n**Description**: Inserts a new node with the specified data before the given node. If the node is the head, it uses `pushToFront`.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time as it involves adjusting pointers around the node.\n- **Space**: O(1) - No additional space is required beyond the new node.\n\n#### \n```\npopFront()\n```\n\n**Description**: Removes and returns the element at the front of the list. Throws an exception if the list is empty.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time by adjusting the head pointer.\n- **Space**: O(1) - No additional space is required.\n\n \n```\npopBack()\n```\n\n**Description**: Removes and returns the element at the end of the list. Throws an exception if the list is empty.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time by adjusting the tail pointer.\n- **Space**: O(1) - No additional space is required.\n\n```\nremove(T data)\n```\n\n**Description**: Removes the first occurrence of the specified data from the list.\n\n**Complexity**: \n- **Time**: O(n) - The operation requires traversal of the list to find the element.\n- **Space**: O(1) - No additional space is required beyond the node being removed.\n\n```\nremove(int index)\n```\n\n**Description**: Removes the element at the specified index.\n\n**Complexity**: \n- **Time**: O(n) - The operation requires traversal of the list to find the element.\n- **Space**: O(1) - No additional space is required beyond the node being removed.\n\n```\nremove(Node\u003cT\u003e node)\n```\n**Description**: Removes the specified node from the list.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time by adjusting pointers around the node.\n- **Space**: O(1) - No additional space is required.\n\n```\ncount()\n```\n\n**Description**: Returns the number of elements in the list.\n\n**Complexity**: \n- **Time**: O(n) - The operation requires traversal of the list to count the elements.\n- **Space**: O(1) - No additional space is required.\n\n```\nisEmpty()\n```\n\n**Description**: Checks if the list is empty.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time by checking pointers.\n- **Space**: O(1) - No additional space is required.\n\n```\ngetData(Node\u003cT\u003e node)\n```\n\n**Description**: Returns the data stored in the specified node.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time.\n- **Space**: O(1) - No additional space is required.\n\n```\ngetHead()\n```\n\n**Description**: Returns the head node of the list.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time.\n- **Space**: O(1) - No additional space is required.\n\n```\ngetTail()\n```\n\n**Description**: Returns the tail node of the list.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time.\n- **Space**: O(1) - No additional space is required.\n\n```\ngetPrev(Node\u003cT\u003e node)\n```\n\n**Description**: Returns the previous node of the specified node.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time.\n- **Space**: O(1) - No additional space is required.\n\n```\ngetNext(Node\u003cT\u003e node)\n```\n\n**Description**: Returns the next node of the specified node.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time.\n- **Space**: O(1) - No additional space is required.\n\n ```\n splice(Node\u003cT\u003e dest, Node\u003cT\u003e from, Node\u003cT\u003e to)\n ```\n\n**Description**: Moves a sublist (from `from` to `to`) and inserts it before `dest`. Throws an exception if any of the nodes are null.\n\n**Complexity**: \n- **Time**: O(1) - The operation is performed in constant time by adjusting pointers around the nodes.\n- **Space**: O(1) - No additional space is required.\n\n\n## Testing\n\n### Test-Driven Development (TDD)\n\nTest-Driven Development (TDD) has been a core methodology in the development of this `DoublyLinkedListImpl` class. TDD emphasizes writing tests before implementing functionality, which ensures that the code is driven by test cases from the outset. \n\n#### How to run tests:\n```\nmvn test\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildandart%2Fdoublylinkedlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildandart%2Fdoublylinkedlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildandart%2Fdoublylinkedlist/lists"}