Code Monkey home page Code Monkey logo

dsa-stack's Introduction

Software Engineer

LinkedIn | Website | Substack | Medium | Twitter

My Interests

Full Stack Web Development | Programming Languages | Design Patterns | Mobile Development

Languages

Go | TypeScript | Kotlin | Java | Python | C

Databases

PostgreSQL | MongoDB | Redis

Frameworks

React.js | Next.js | Vue.js | NestJS | Hono

Other

AWS | Docker | React Native

Recent Articles


  • I'm currently working on
    • Wanderlust: An application to review, share, and discover points of interests.

dsa-stack's People

Contributors

mertturkmenoglu avatar

Watchers

 avatar

dsa-stack's Issues

User Deletion Error While Deleting Root

I was just wandering around and i just realised that delete function does not update the root of the tree, it occures to me that your code has what i call " Pass by value by using pointer " issue.

11
12
13

  • If you look carefully 31 is the head of the tree and 32 is the node that is inorder successor of the root so when i delete id 31, delete function only changes the id of the root to the 32 but doesn't necessarily deletes the node.

  • Indeed from the perspective i see, the problem arises even if you successfully delete the root inside of the delete function.

    • This is because when you delete the root of the tree you'll need to update the root but when the delete function returns the new node of the tree, the caller of the delete function, deleteUserHandler will take that node and put it into the struct node* root which is actually just a pointer created for this function inside of the stack, if you were to update this pointer what will happen is that the change to the pointer will be deleted after deleteUserHandler function terminates since this function only returns boolean value back. This is what i call as pass by value using pointers

    • To solve the issue you have a few options

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.