-
Notifications
You must be signed in to change notification settings - Fork 0
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
insert and read tree #5
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for parths-algorithms ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
❌ Changes requested. Reviewed everything up to c8dff3d in 1 minute and 4 seconds
More details
- Looked at
205
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. src/app/dsa/tree/tree.ts:1
- Draft comment:
The import ofroot
frompostcss
appears to be unused and should be removed to clean up the code. - Reason this comment was not posted:
Confidence of 0% on close inspection, compared to threshold of 50%.
Workflow ID: wflow_72PGy2yQhGJg6psL
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
// } | ||
|
||
// takes a value and a tree (root) and returns a new tree (root) | ||
const insertNode = (value: number, root: Node): Node => { |
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.
The insertNode
function does not handle the case where the inserted value is equal to the current node's value. Consider adding logic to handle this scenario to prevent potential issues.
|
||
|
||
} | ||
const readTree = (root: Node, callback: Function) => { |
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.
The callback parameter in readTree
is typed as Function
, which is not type-safe. Consider defining a more specific function type for better type safety and clarity.
</div> | ||
<div className="flex flex-col underline items-center"> | ||
|
||
<Link href="/algorithms/bubblesort"> |
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.
The links in this component still point to the old /algorithms
path. Update the href
attributes to point to the correct paths under /dsa
to ensure the links work correctly.
<Link href="/algorithms/bubblesort"> | |
<Link href="/dsa/bubblesort"> |
Summary:
Restructured project files for algorithms and data structures, added tree data structure implementation, and updated redirection path.
Key points:
src/app/algorithms/page.tsx
.src/app/algorithms
tosrc/app/dsa
.src/app/dsa/page.tsx
to include links to algorithms and data structures.src/app/dsa/tree/tree.ts
withinsertNode
andreadTree
functions.src/app/page.tsx
to redirect from/algorithms
to/dsa
.Generated with ❤️ by ellipsis.dev