Giter Site home page Giter Site logo

data-structures-and-algorithms's Introduction

Hi ๐Ÿ‘‹, I'm Shreeansh

A developer by profession

  • ๐Ÿ”ญ Iโ€™m currently working on my personal development project and other things

  • ๐ŸŒฑ Iโ€™m currently learning about Typescript, Microservices related topics

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my projects are available at My repositories

  • ๐Ÿ’ฌ Ask me about react and javascript or it can be MERN stack

  • ๐Ÿ“ซ How to reach me [email protected]

data-structures-and-algorithms's People

Contributors

ashleymays avatar binarybeast007 avatar cneal111 avatar harshchan avatar harshil-gupta avatar keshav002 avatar mahathi1404 avatar manevivek avatar mrunal-13 avatar nandan-wewhare avatar puneetpotter avatar rahullo avatar shree1999 avatar shubham-lohan avatar sunwoongc avatar t19700 avatar untilhamza avatar velkur-bharath avatar vikkastiwari avatar ybrenning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-structures-and-algorithms's Issues

Add methods to access Linked List elements

Implement a get() method to access the element at a certain index of the Linked List and a find() method to search for an element with a specific value and return its index.

[LOGIC] - BST REMOVE NODE

In the below code snippet from BST under the deleteNode function. The logic is quite unclear for me like how it is working for the below case.

            Root
           /    \
     child1   child2
     /   \      
 Null   leaf1

Code Snippet

else if (temp->left == NULL || temp->right == NULL)
                {
                    cout << "We are deleting parent node which have one child" << endl;
                    if (temp->left != NULL)
                    {
                        parent->left = temp->left;
                    }
                    else
                    {
                        parent->right = temp->right;
                    }
                    free(temp);
                    return;
                }

If you can put light on it then it would be a great help :)

Delete Function [BST]

cout << "Deleting Node which has two children" << endl;
// in this case we need to find the pre-order successor.
Node *t = temp->right;
if (t->left == NULL && t->right == NULL)
{
    temp->data = t->data;
    temp->right = NULL;
    free(t);
    return;
}
else if (t->left == NULL && t->right != NULL)
{
    temp->data = t->data;
    temp->right = t->right;
    free(t);
    return;
}
while (t->left != NULL)
{
    parent = t;
    t = t->left;
}
temp->data = t->data;
parent->left = NULL;
free(t);
return;

In the above code snippet of the Delete function from BST. Please mention cases that we are handling.

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.