-
Notifications
You must be signed in to change notification settings - Fork 4
Tests/binarysearch #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ss for element management; add tests for Node class behavior
There was a problem hiding this 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.
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>
This pull request refactors the implementations of the queue and stack data structures to use linked lists instead of arrays, introducing a custom
Nodeclass for each. It also updates the test suites to include direct and indirect tests for the newNodeclasses. 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 aNodeclass, replacing the previous array-based approach. TheNodeclass is now exported for testing.linear/stack.js: Refactored the stack implementation to use a singly linked list with aNodeclass, replacing the previous array-based approach. TheNodeclass is made accessible for tests via the prototype chain.Testing Enhancements:
tests/queue.test.js: Added tests for theNodeclass and for verifying that the queue uses linked nodes internally.tests/stack.test.js: Added tests for theNodeclass, including its ability to store different value types and link to other nodes.Workflow Cleanup:
.github/workflows/github-actions-demo.yml: Removed the GitHub Actions demo workflow file.