Open In App

Top 10 Algorithms and Data Structures for Competitive Programming

Last Updated : 15 Dec, 2022
Like Article

In this post, we will discuss Important top 10 algorithms and data structures for competitive coding.

Topics : 

  1. Graph algorithms
  2. Dynamic programming
  3. Searching and Sorting:
  4. Number theory and Other Mathematical
  5. Geometrical and Network Flow Algorithms
  6. Data Structures


The links below cover most important algorithms and data structure topics:

Graph Algorithms

  1. Breadth First Search (BFS)
  2. Depth First Search (DFS)
  3. Shortest Path from source to all vertices **Dijkstra**
  4. Shortest Path from every vertex to every other vertex **Floyd Warshall**
  5. Minimum Spanning tree **Prim**
  6. Minimum Spanning tree **Kruskal**
  7. Topological Sort
  8. Johnson’s algorithm
  9. Articulation Points (or Cut Vertices) in a Graph
  10. Bridges in a graph

All Graph Algorithms 

Dynamic Programming

  1. Longest Common Subsequence
  2. Longest Increasing Subsequence
  3. Edit Distance
  4. Minimum Partition
  5. Ways to Cover a Distance
  6. Longest Path In Matrix
  7. Subset Sum Problem
  8. Optimal Strategy for a Game
  9. 0-1 Knapsack Problem
  10. Assembly Line Scheduling

All DP Algorithms

Searching And Sorting

  1. Binary Search
  2. Quick Sort
  3. Merge Sort
  4. Order Statistics
  5. KMP algorithm
  6. Rabin karp
  7. Z’s algorithm
  8. Aho Corasick String Matching
  9. Counting Sort
  10. Manacher’s algorithm: Part 1, Part 2 and Part 3

All Articles on Searching, Sorting and Pattern Searching

Number theory and Other Mathematical

Prime Numbers and Prime Factorization 

  1. Primality Test | Set 1 (Introduction and School Method)
  2. Primality Test | Set 2 (Fermat Method)
  3. Primality Test | Set 3 (Miller–Rabin)
  4. Sieve of Eratosthenes
  5. Segmented Sieve
  6. Wilson’s Theorem
  7. Prime Factorization
  8. Pollard’s rho algorithm

Modulo Arithmetic Algorithms 

  1. Basic and Extended Euclidean algorithms
  2. Euler’s Totient Function
  3. Modular Exponentiation
  4. Modular Multiplicative Inverse
  5. Chinese remainder theorem Introduction
  6. Chinese remainder theorem and Modulo Inverse Implementation
  7. nCr%m and this.


  1. Counting Inversions
  2. Counting Inversions using BIT
  3. logarithmic exponentiation
  4. Square root of an integer
  5. Heavy light Decomposition , this and this
  6. Matrix Rank
  7. Gaussian Elimination to Solve Linear Equations
  8. Hungarian algorithm
  9. Link cut
  10. Mo’s algorithm and this
  11. Factorial of a large number in C++
  12. Factorial of a large number in Java+
  13. Russian Peasant Multiplication
  14. Catalan Number

All Articles on Mathematical Algorithms 

Geometrical and Network Flow Algorithms

  1. Convex Hull
  2. Graham Scan
  3. Line Intersection
  4. Interval Tree
  5. Matrix Exponentiation and this
  6. Maxflow Ford Furkerson Algo and Edmond Karp Implementation
  7. Min cut
  8. Stable Marriage Problem
  9. Hopcroft–Karp Algorithm for Maximum Matching
  10. Dinic’s algo and e-maxx

All Articles on Geometric Algorithms 

Data Structures

  1. Binary Indexed Tree or Fenwick tree
  2. Segment Tree (RMQ, Range Sum and Lazy Propagation)
  3. K-D tree (See insert, minimum and delete)
  4. Union Find Disjoint Set (Cycle Detection and By Rank and Path Compression)
  5. Tries
  6. Suffix array (this, this and this)
  7. Sparse table
  8. Suffix automata
  9. Suffix automata II
  10. LCA and RMQ

All Articles on Advanced Data Structures. 

How to Begin? 
Please see How to begin with Competitive Programming? 

How to Practice? 
Please see 

What are top algorithms in Interview Questions? 
Top 10 algorithms in Interview Questions 

How to prepare for ACM – ICPC? 
How to prepare for ACM – ICPC? 

This is an initial draft. We will soon be adding more links and algorithms to this post.

The biggest mistake programmers make is probably getting discouraged and not practicing enough. Or practicing only on problems they feel they’re good at.
– Derek Kisman, aka SnapDragon

Related Courses

Competitive Programming – Live Course

Taking the first step is always hard, isn’t it? But we say no, why? Because we’ve brought a course that will help you to top the charts of leading coding competitions and interviews. Great right? You can start your journey of being a Competitive Programmer now, but before you start know the basics of Data structures and algorithms and programming foundations. Enrol Today, we’ll see you inside the course.

Previous Article
Next Article

Similar Reads

Tips and Tricks for Competitive Programmers | Set 2 (Language to be used for Competitive Programming)
This is a question asked quite often as in which language should be preferred to be efficient in competitive programming. It is something one should not worry about as what matters is the logic, not the language. Most of the languages are more or less same, but till now the most preferred language is C++, and here are the reasons. Python Simple and
5 min read
Top Programming Languages For Competitive Programming
Building an application, running a server, or even implementing a game needs a programming language as the foundation. There are almost more than 700 programming languages which are the most popular ones and this number will increase day by day. But, you don't need to learn all of them. Having a good command of anyone is enough for you to grow your
13 min read
Top Data Structures and Algorithms Courses for Java Developers [2024]
Java has great demand and there are almost more than a million Java developers in the world. It is one of the most popular programming languages and top-notch companies (Netflix, Uber, Google, and Amazon) use it in their back-end services. The average salary of a Java developer ranges from 3 LPA to 10 LPA, in India, depending on experience. Since D
8 min read
Top Reasons for Failure in Data Structures and Algorithms
Data structures and algorithms are fundamental building blocks in computer science and programming. Failure in understanding, implement, or utilize them effectively can lead to various problems and hinder a programmer's ability to solve complex problems efficiently. Let's Discuss why people face failure while preparing and learning for Data Structu
9 min read
Does a Data Scientist/Machine Learning Engineer require in depth knowledge of Data Structures and Algorithms?
In today's world, data scientists and machine learning engineers play a crucial role in analyzing data and building intelligent systems. As technology continues to advance, the demand for these experts is growing rapidly. Real-world data problems are complex, requiring strong skills in handling data and creating efficient algorithms. In this articl
10 min read
Stars and Bars Algorithms for Competitive Programming
The Stars and Bars (also known as Balls and Urns) technique is a popular method used in Combinatorics, the study of counting and arrangement. It's a graphical way to solve certain types of problems and is particularly useful when dealing with problems related to the distribution of identical objects into distinct groups. This article will introduce
14 min read
Competitive Programming vs General Programming
Programming enthusiasts face a crossroads - Competitive Programming or General Programming? This article sheds light on the distinctions between Competitive Programming vs General Programming, offering a quick guide for those navigating the coding landscape. Whether you're aiming for speed and precision in competitions or tackling real-world projec
3 min read
Dynamic Programming in Game Theory for Competitive Programming
In the fast-paced world of competitive programming, mastering dynamic programming in game theory is the key to solving complex strategic challenges. This article explores how dynamic programming in game theory can enhance your problem-solving skills and strategic insights, giving you a competitive edge. Whether you're a seasoned coder or a newcomer
15+ min read
Top 10 Most Used Inbuilt C++ functions for Competitive Programming
In this article, we will discuss about the 10 most used inbuilt functions of C++ which will help you to save time and make code concise as well during competitive programming. List of top 10 inbuilt functions in C++ pow()sqrt()min()max()swap()gcd()toupper()tolower()floor()ceil()1. pow( ) This function helps to find the value of a number raised to a
7 min read
Need of Data Structures and Algorithms for Deep Learning and Machine Learning
Deep Learning is a field that is heavily based on Mathematics and you need to have a good understanding of Data Structures and Algorithms to solve the mathematical problems optimally. Data Structures and Algorithms can be used to determine how a problem is represented internally or how the actual storage pattern works & what is happening under
6 min read