Templates, algorithms and data structures implemented and collected for programming contests.

Overview

This is my personal code library where I compiled almost all the important templates that you will need in CP (saying almost just for courtesy). Most of the codes are originally written by me and some of them are collected from others but modified in a cleaner way.

It took me around 4 years to complete the list. Maybe each line is just a line to you but to me it tells a story of the excitements I had while learning those stuffs, the sleepless but fun nights I had to seek knowledge.

Why am I sharing this library?

  • Just so that your learning path becomes a bit smoother.
  • Knowledge hidden inside my head or codes in a private code-library will be useless when I am dead, so it's better to share those among people before I die.

Also, you can make me happy(as in to pay me) just by giving a star to the repository.

I believe that my coding style is pretty clean and readable, and furthermore, a few problem links are attached to most of the codes so that you can practice those problems. Best wishes, my friend blobheart.

You might also like...
The aim of this repository is to make it a one final stop for revision for technical interviews involving data structures and algorithms .

Hey 🙋‍♂️ This repository is meant for data structures and algorithms . I will be updating this often and will include all the data structures importa

Implementation of various data structures and algorithms.
Implementation of various data structures and algorithms.

Data Structures and Algorithms A place where you can find and learn the copious number of algorithms in an efficient manner. This repository covers va

Data structures and algorithms course, winter 2021/22

Data Structures and Algorithms 2021/22 Repository for the "Data structures and algorithms" course for the 2021/22 academic year. Structure lectures --

A repository by Codechef@MUST for data structures and algorithms
A repository by [email protected] for data structures and algorithms

DSA Overview The main goal of this project is to promote open-source, allowing anyone who wants to contribute. This repository would be focused on var

Personal reference material for Data Structures and Algorithms
Personal reference material for Data Structures and Algorithms

🔗 DSA 📈 Sr Filename Title Notes 1 2-1_datatypes_and_modifiers.cpp Datatypes and Modifiers Type modifiers explained 2 2-2_input_output.cpp stdin and

Redacted source code for exercises proposed in the Data Structures and Algorithms laboratory.

fsega_ie2_dsa Redacted source code for exercises proposed in the Data Structures and Algorithms laboratory. Usage The src/ directory contains a direct

Data Structures and Algorithms course (IIC2133-PUC)

Data-Structures-And-Algorithms This are the homeworks of Jose Antonio Castro from Data Structures and Algorithms course (IIC2133) in Pontificia Univer

100daysofDSA - Explore about arrays, linked lists, stacks & queues, graphs, and  more to master the foundations of data structures & algorithms!
100daysofDSA - Explore about arrays, linked lists, stacks & queues, graphs, and more to master the foundations of data structures & algorithms!

Explore about arrays, linked lists, stacks & queues, graphs, and more to master the foundations of data structures & algorithms!

Implementation of data structures and algorithms in C language

DataStructure_and_Algorithms_in_C Implementation of basic data structures and algorithms in C Data Structure LinkedList Singly Linked List Doubly Link

Comments
  • How was this line declared

    How was this line declared

    I can't understand how did you declare this line?

    https://github.com/ShahjalalShohag/code-library/blob/cf3039641b5aa84b1c5b184a95d69bd4091974c9/Data%20Structures/Treap.cpp#L6

    opened by touhidurrr 1
  • Monotonic MinMaxQueue

    Monotonic MinMaxQueue

    My Implementation of monotonic Minimum and Maximum Queue:

    template<typename T>
    class MinMaxQueue {    
    public:
        deque<T> q, minq, maxq;
        
        void push_back(T val) {
            q.push_back(val);
            while(!minq.empty() and minq.back() > val)
                minq.pop_back();
            while(!maxq.empty() and maxq.back() < val) 
                maxq.pop_back();
            minq.push_back(val);
            maxq.push_back(val);
        }
        
        void pop_front() {
            T val = q.front(); q.pop_front();
            if(val == minq.front())
                minq.pop_front();
            if(val == maxq.front())
                maxq.pop_front();
        }
        
        T min() {
            return minq.front();
        }
        
        T max() {
            return maxq.front();
        }
        
        T front() {
            return q.front();
        }  
    
        int size() {
            return q.size();
        }
    
        bool empty() {
            return q.empty();
        }
    };
    

    Tested it on: Problem: https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/ My Solution: https://leetcode.com/submissions/detail/792036375/

    References:

    • https://cp-algorithms.com/data_structures/stack_queue_modification.html#queue-modification-method-1
    • https://www.youtube.com/watch?v=9hd8UFAYa1c&t=1054s
    opened by still-n0thing 0
  • issue: Uninitialized variable: `ty` in `Graph Theory/Maximum Independant Set.cpp` file - line 74

    issue: Uninitialized variable: `ty` in `Graph Theory/Maximum Independant Set.cpp` file - line 74

    Link issue

    for (int i = 1; i <= n + 1; i++) {
        int ty; // Uninitialized variable: ty - when i is equal to n+1
        if (i <= n) cin >> ty;
        if (ty == 1 || i > n) {
          for (auto x : se) for (auto y : se) g[x - 1][y - 1] = 1, g[y - 1][x - 1] = 1;
          se.clear();
        } else {
          string s;
          cin >> s;
          if (mp.find(s) == mp.end()) {
            mp[s];
            mp[s] = mp.size();
          }
          int p = mp[s];
          se.insert(p);
        }
      }
    
    opened by LuisMBaezCo 0
Owner
Shahjalal Shohag
Shahjalal Shohag
Data Structures and Algorithms implemented in C++

OpenOcto - Data Structures and Algorithms Data Structures and Algorithms implemented in C++ Code here directly using Gitpod! Everthing done in C++ All

null 4 Oct 5, 2022
This is a beginner-friendly project aiming to build a problem-set on different data structures and algorithms in different programming languages.

DSAready Overview This is a beginner-friendly project that aims to create a problem-set for various Data Structures and Algorithms. Being a programmer

Riddhi Jain 13 Aug 17, 2022
A collection of multiple types of lists used during pentesting, collected in one place. List types include usernames, passwords, combos, wordlist and may more..

Access list is a collection of multiple types of lists used during pentesting, collected in one place, created by Undercode This list include a collec

UNDERCODE UTILITIES 10 Nov 21, 2022
Some data structures are implemented in C++ here

CPP Data Structure Implementation Data structures implementation in this repo. Small story ?? I decided to improve myself by implementing data structu

Tsuen Hsueh 1 Nov 14, 2022
Repository of problems and solutions of labsheets used for Data Structures and Algorithms (CS F211) in Semester 2, 2020-21 at BITS Pilani - Hyderabad Campus.

CS F211 Data Structures and Algorithms (BITS Pilani - Hyderabad Campus) This repository contains the problems, solution approaches & explanations and

Rohit Dwivedula 27 Oct 31, 2022
Algo-Tree is a collection of Algorithms and data structures which are fundamentals to efficient code and good software design

Algo-Tree is a collection of Algorithms and data structures which are fundamentals to efficient code and good software design. Creating and designing excellent algorithms is required for being an exemplary programmer. It contains solutions in various languages such as C++, Python and Java.

DSC-Banasthali 53 Oct 4, 2022
🔗 Common Data Structures and Algorithms

?? Data Structures and Algorithms This library provides common data structures. It will also provide some data structures which needed in render or ga

Recep Aslantas 44 Nov 28, 2022
Wonderful library with lots of useful functions, algorithms and data structures in C, link it with -l9wada

Lib9wada Wonderful library with lots of useful functions, algorithms and data structures in C, link it with -l9wada Usage Compile the library with mak

Lprogrammers Lm9awdine 53 Nov 21, 2022
Wonderful library with lots of useful functions, algorithms and data structures in C, link it with -l9wada

LibC+ Wonderful library with lots of useful functions, algorithms and data structures in C, link it with -lC+ Better than C, not as much as c++ Usage

BnademOverflow 53 Nov 21, 2022