Skip to content
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

Delete node function for tree #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

parth-agrawal
Copy link
Collaborator

@parth-agrawal parth-agrawal commented Jun 26, 2024

🚀 This description was created by Ellipsis for commit a598594

Summary:

Reorganized project structure, added tree operations, and updated redirection path.

Key points:

  • Deleted src/app/algorithms/page.tsx.
  • Renamed src/app/algorithms/bubblesort/bubbleSort.ts to src/app/dsa/bubblesort/bubbleSort.ts.
  • Renamed src/app/algorithms/bubblesort/page.tsx to src/app/dsa/bubblesort/page.tsx.
  • Renamed src/app/algorithms/insertionsort/insertionSort.ts to src/app/dsa/insertionsort/insertionSort.ts.
  • Renamed src/app/algorithms/insertionsort/page.tsx to src/app/dsa/insertionsort/page.tsx.
  • Renamed src/app/algorithms/quicksort/page.tsx to src/app/dsa/quicksort/page.tsx.
  • Renamed src/app/algorithms/quicksort/quicksort.ts to src/app/dsa/quicksort/quicksort.ts.
  • Added src/app/dsa/tree/tree.ts with insertNode, readTree, and deleteNode functions.
  • Updated src/app/page.tsx to redirect to /dsa instead of /algorithms.

Generated with ❤️ by ellipsis.dev

Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for parths-algorithms ready!

Name Link
🔨 Latest commit a598594
🔍 Latest deploy log https://app.netlify.com/sites/parths-algorithms/deploys/667c8d7097b4140008061537
😎 Deploy Preview https://deploy-preview-6--parths-algorithms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@ellipsis-dev ellipsis-dev bot left a 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 a598594 in 51 seconds

More details
  • Looked at 288 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_qCFbzkCfKuIYEudJ


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.

@@ -0,0 +1,154 @@
import { root } from "postcss"
Copy link

Choose a reason for hiding this comment

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

This import of root from postcss appears to be unused and should be removed to keep the code clean and relevant.

if (root.leftNode && root.rightNode) {
const nextNode = findNextNode(root.rightNode)
const tempValue = nextNode.value
deleteNode({ value: nextNode.value, root: root })
Copy link

Choose a reason for hiding this comment

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

Recursive deletion in deleteNode function might cause issues if the node to delete is the root itself. Consider handling the case where the node to delete is the root to prevent potential infinite recursion or incorrect tree manipulation.




const findNextNode = (root: Node) => {
Copy link

Choose a reason for hiding this comment

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

The findNextNode function incorrectly assumes the next node is always the left-most child. This does not account for the right children, which should be considered when finding the next node in in-order traversal. Consider revising this function to correctly handle finding the next node.

</div>
<div className="flex flex-col underline items-center">

<Link href="/algorithms/bubblesort">
Copy link

Choose a reason for hiding this comment

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

The links in this file still point to /algorithms/... paths, but should be updated to /dsa/... to reflect the new directory structure and ensure they lead to the correct pages.

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