Git Product home page Git Product logo

cp's Introduction

Competitive Programming

#include "cp.h"

A repository containing my implementations of popular algorithms used in competitive programming and interviews

1. Arrays

  • Longest Bitonic Subarray
  • Longest Increasing Subsequence using Patience Sort
  • Maximum Subarray using Kadane
  • Remove duplicates in sorted array

2. Sorting

  • Bubble sort
  • Selection sort
  • Insertion sort
  • Quicksort
  • Mergesort

3. Strings

  • KMP
  • Z algorithm
  • Longest Palindromic substring using Manacher's algorithm
  • Palindrome partitioning using Manacher
  • Count character occurrences in sorted string
  • Remove K consecutive same characters

4. Trees

  • Insertion
  • Deletion
  • InOrder, PreOrder, PostOrder, LevelOrder traversal
  • InOrder traversal using stack
  • Search
  • InOrder successor and predecessor
  • Height of tree
  • Diameter of tree
  • Sum of nodes
  • Lowest Common Ancestor

5. Backtracking

  • N Queens

6. DP

  • 0/1 Knapsack
  • stock price (leetcode problem)
  • Longest common subsequence
  • Longest common substring
  • Edit Distance
  • candles (atcoder problem)

7. Graph

  • Graph insertion
  • BFS
  • DFS
  • Dijkstra
  • Kruskal
  • Prims
  • Topological sort
  • Kahn's algorithm for topological sort
  • Fox and Names codeforces 510/C using Kahn's algorithm
  • Tarjan's algorithm for bridges and articulation points
  • Ford-Fulkerson Edmond's-Karp Max Flow algorithm

8. Advanced DS

  • Segment Tree
  • Trie

9. Bit Manipulation

  • hack1: basic stuff
  • hack2: K'th bit
  • hack3: rightmost set bit
  • hack4: letters

cp's People

Contributors

menon99 avatar

Watchers

 avatar

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.