Skip to content

Conversation

@adasarpan404
Copy link
Owner

This pull request refactors the implementations of the queue and stack data structures to use linked lists instead of arrays, introducing a custom Node class for each. It also updates the test suites to include direct and indirect tests for the new Node classes. Additionally, it removes a GitHub Actions workflow file.

Data Structure Refactoring:

  • linear/queue.js: Refactored the queue implementation to use a singly linked list with a Node class, replacing the previous array-based approach. The Node class is now exported for testing.
  • linear/stack.js: Refactored the stack implementation to use a singly linked list with a Node class, replacing the previous array-based approach. The Node class is made accessible for tests via the prototype chain.

Testing Enhancements:

  • tests/queue.test.js: Added tests for the Node class and for verifying that the queue uses linked nodes internally.
  • tests/stack.test.js: Added tests for the Node class, including its ability to store different value types and link to other nodes.

Workflow Cleanup:

Copilot AI review requested due to automatic review settings August 17, 2025 12:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the queue and stack data structures from array-based to linked list-based implementations using custom Node classes, and updates the test suites to verify the new implementations work correctly.

  • Refactored queue and stack to use linked lists with Node classes instead of arrays
  • Added comprehensive test coverage for Node classes and internal structure verification
  • Removed unused GitHub Actions demo workflow file

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
linear/queue.js Refactored to use linked list with Node class, exports Node for testing
linear/stack.js Refactored to use linked list with Node class, makes Node accessible via prototype chain
tests/queue.test.js Added Node class tests and internal structure verification tests
tests/stack.test.js Added Node class tests using indirect access method
.github/workflows/github-actions-demo.yml Removed demo workflow file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

adasarpan404 and others added 4 commits August 17, 2025 17:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adasarpan404 adasarpan404 merged commit 9bbbc6e into master Aug 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant