Coder Social home page Coder Social logo

amitbansal7 / data-structures-and-algorithms Goto Github PK

View Code? Open in Web Editor NEW
257.0 10.0 91.0 99 KB

Implementation of various Data Structures and algorithms - Linked List, Stacks, Queues, Binary Search Tree, AVL tree,Red Black Trees, Trie, Graph Algorithms, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Segment Trees etc.

C 57.10% C++ 40.33% Java 2.15% Scala 0.41%
tree algorithms graph-algorithms linked-list dynamic-programming segment-tree greedy-algorithms sorting-algorithms avl-tree redblacktree trie binary-search-tree queue data-structures greedy-algorithm cpp c sorting sorting-algorithms-implemented sorting-algorithm

data-structures-and-algorithms's Introduction

DataStructures and Algorithms in C/C++

This code is written by Amit Bansal while learning Data structures and algorithms. References GFG, NPTEL, CLRS.

This repository contains:

Singly Linked List.

        Add Two Numbers Represented By Linked List.
        Bubble Sort in Linked List
        Merge Sort in Linked List
        Merge Sorted Linked List
        Reverse a singly Linked List with or without using stack

Doubly Linked List.

Circular Linked List.

        Sorted Insert

Stack using array and Linked List.

Queue using array and Linked List.

Priority Queue.

Sorting:

        Bubble Sort
        Heap Sort
        Insertion Sort
        Merge Sort
        Quick Sort
        Selection Sort

Binary Search Tree

        Insertion
        Deletion
        Preorder traversal
        Inorder traversal
        Postorder traversal
        Level order traversal
        Find Height of a Binary Search Tree
        Check if a Tree is Binary Search Tree or not(2 methods)
        Find Max and Min element in Binary Search Tree

AVL trees

        a.Insertion
        b.Deletion

Red Black Trees

        Insertion
        Deletion

Tries

        Insert
        Delete
        Search

Graphs

        Breadth First Search
        Depth Search Search
        Kosaraju's algorithm for strongly connected components
        Dijkstra's algorithm for single source shortest paths
        A* Search Algorithm
        Kruskal’s Minimum Spanning Tree Algorithm
        Topological Sorting
        Prims algorithm for minimum spanning tree using STL
        Floyd Warshall Algorithm for all pairs shortest paths
        Bellmanford algorithm for single source shortest path and negative edge cycle detection
        Detect a cycle using DFS
        Sortest Paths using Breadth First Search
        Check if an undirected Graph is eulerian.
        Find diameter of a tree using BFS
        Check if a graph is Bipartite using BFS
        Longest path in a directed acyclic graph

Flow Networks

        Ford-Fulkerson Algorithm for Maximum Flow

Greedy Algorithms

        Activity Selection Problem.
        Kruskal’s Minimum Spanning Tree Algorithm
        Dijkstra's algorithm for single source shortest paths
        Minimize Lateness problem
        Huffman Coding

Dynamic Programming

        Boolean Parenthesization Problem
        Edit Distance
        Knapsack problem with repetitions
        Knapsack Problem
        Longest Increasing Subsequence
        Maximum Value Contiguous Subsequence
        Optimal Strategy for a Game
        Optimal binary search trees
        RNA Secondary structure
        Rod Cutting
        Balanced Partition
        Box stacking
        Building Bridges
        Fibonnaci Numbers
        Longest increasing subsequence
        Maximum Value Contiguous Subsequence
        Subset Sum Problem
        Coin Changing Problem

Backtracking

        Alphacode: All possible codes that an integer string can generate
        String Permutation Algorithm
        Find Power Set of a set

Segment Tree

        Range Minimum Query
        Range Sum Query

data-structures-and-algorithms's People

Contributors

amitbansal7 avatar

Stargazers

 avatar fiso avatar Saumya Yadav avatar Võ Chí Lâm avatar Gabriel Jesus avatar pp P avatar  avatar Cavid Abbasaliyev avatar Luiz Guilherme avatar shuai avatar  avatar Dmitriy avatar Balqis Rahmani Faliha avatar  avatar Jack Crosby avatar anzye avatar pix3l_p33p3r avatar  avatar  avatar KANG DOHYUN avatar  avatar Víctor Sanz avatar  avatar Tim Zgeybi avatar Mahmudul Haque Sakib avatar  avatar Zhang Wei avatar  avatar  avatar palu avatar  avatar  avatar Rovaya Haque Shuvo avatar Ashmita avatar Berkay Cerit avatar Rituparn Shukla avatar SantiagoBescos avatar Muhammad Ali avatar Darweshi Gyton-Baptiste avatar Eugene avatar Lu avatar  avatar  avatar Heloísa Pazeti avatar miko53 avatar Gildas Le Drogoff avatar JeongHoon Baek avatar Brendon Silva avatar Guilherme Fernandes Medeiros avatar Mohammed Abdullah avatar Sergey Fetisov avatar . avatar  avatar  avatar 程志明 avatar Nikhil Reddy avatar  avatar Cristian-Andrei Tudor avatar Shaad Iqbal avatar Ahmed avatar Chandra Mohan Sah avatar Andrea Ardu avatar Jasmine Nayla Hafiezh avatar  avatar Camila Maia de Almeida avatar Sergey Fedorov avatar  avatar C+iph/er  avatar Lukachu avatar sergio avatar  avatar Pawel Śmigielski avatar BluePurple avatar Fakhri Alauddin avatar  avatar  avatar Berkay Sahin avatar Mandeep Kumbhar avatar Nadire Nur Sağlam avatar  avatar  avatar Bhadriraju Venkata Naga Sameera Diwakar avatar Ltxx avatar M. Nart avatar Kwabena Boadi Sapong avatar Annamalai avatar Aditya Parikh avatar Supta Richard Philip avatar  avatar  avatar Jun-323 avatar  avatar Raghav Nallaperumal avatar G.p.s.Vishnu vardhan avatar Pedro Akira avatar  avatar Argel Capela avatar  avatar  avatar  avatar

Watchers

Young avatar GURPARKAR SINGH avatar  avatar  avatar John Buck avatar Christos Kolokythas avatar  avatar Vignesh A S avatar  avatar  avatar

data-structures-and-algorithms's Issues

The height of the node in AVL tree is wrong

I input the data 10, 4, 6. After the rebalance, the height of each of the three nodes should be ZERO. However, in your AVL tree code, the height isn't ZERO. You can check it.

RBT segfaults

Make an RBT Tree with elements from 1 to 21, including both. Now try to delete 12 the program will segfault for trying to illegally write to memory via the line

            x->parent = y;

from the main else block in RB_delete

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.