Giter VIP home page Giter VIP logo

data-structures-and-algorithms's Introduction

Data Structures and Algorithms

Welcome

Hello and welcome to an open souce project created by shree1999! This project is designed to help beginner computer science students a place to learn and practice data structures and algorithms common to computer science. The goal is for you to be able to learn the ins and outs of these structures to the point where you can use them in your own projects and problems. You will find that different structures work better for different kinds of data. Part of the hope with this is that you will begin to gain an understanding of when and where to use different structures. Let's get learning!

What's in this Project?

  • Data Structures:
    • Arrays
    • Graphs
    • Hash Tables
    • Linked Lists
    • Queues
    • Stacks
    • Trees
  • Algorithms:
    • Recursions
      • Factorial
      • Fibonacci
      • Reverse String
    • Searching
      • Breadth First
      • Depth First
      • Dijkstra
      • Bellmann-Ford
      • Binary
      • Linear
    • Sorting
      • Bubble
      • Heap
      • Insertion
      • Merge
      • Quick
      • Selection

All of these examples and problems presented are written in C/C++.

Getting Started

Don't know where to start? Right here is perfect! We will walk you through exactly how to get set up to work with these data structures and algorithms and solve the problems we have set up for you.

  1. To get started, make a fork of this repository.
  2. You will want to have an IDE to work in, Visual Studio or VS Code are typical for C/C++.
  3. In your forked version, press the green code button. Copy the HTTPS link.
  4. Open Visual Studio, select clone a repository
  5. Paste the Link in "Repository Location", and select the destination you want your local copy stored in
  6. Click clone and get started!

Contributions

  • This repository is open for contributions feel free to check the CONTRIBUTING.md file for details on how to add anything I missed

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

[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 :)

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.

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.