The Wayback Machine - https://web.archive.org/web/20240817181053/https://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/
Open In App

Top 10 Algorithms and Data Structures for Competitive Programming

Last Updated : 15 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow
 

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

competitive-programming

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.

Miscellaneous:

  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 https://practice.geeksforgeeks.org/ 

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 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
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
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
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
Why Data Structures and Algorithms are "Must Have" for Developers and Where to learn them : Answered
With advancement and innovation in technology, programming is becoming a highly in-demand skill for Software Developers. Everything you see around yourself from Smart TVs, ACs, Lights, Traffic Signals uses some kind of programming for executing user commands. In order to be irreplaceable, one must always be efficient. Data Structures and Algorithms
4 min read
Data Structures and Algorithms Online Courses : Free and Paid
Data Structures and Algorithms is one of the most important skills that every computer science student must-have. It is often seen that people with good knowledge of these technologies are better programmers than others and thus, crack the interviews of almost every tech giant. Now, you must be thinking to opt for a quality DSA Course to build
8 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
Data Structures and Algorithms | Set 36
Que - 1. The function shiftNode() which takes as input two linked lists- destination and source. It deletes front node from source and places it onto the front of destination. Choose the set of statements which replace X, Y, Z in given function. void shiftNode(struct node** destRoot, struct node** srcRoot) { // the front of source node struct node*
4 min read
Data Structures and Algorithms | Set 37
Que - 1. For 8 keys and 6 slots in a hashing table with uniform hashing and chaining, what is the expected number of items that hash to a particular location. (A) 2.33 (B) 0.75 (C) 1.33 (D) 2 Solution: Probability that key1 ends up in slot 1 = 1/6 Probability that key2 ends up in slot 1 = 1/6 Probability that key3 ends up in slot x = 1/6 Probabilit
4 min read
Difference between Data Structures and Algorithms
What are Data Structures and Algorithms? Data structures and algorithms are two interrelated concepts in computer science. Data structures refer to the organization, storage, and retrieval of data, while algorithms refer to the set of instructions used to solve a particular problem or perform a specific task. Applications of Data Structures and Alg
2 min read
Introduction to Rolling Hash - Data Structures and Algorithms
A rolling hash is a hash function that is used to efficiently compute a hash value for a sliding window of data. It is commonly used in computer science and computational biology, where it can be used to detect approximate string matches, find repeated substrings, and perform other operations on sequences of data. The idea behind a rolling hash is
15+ min read
Are Data Structures and Algorithms important for Web Developers?
Web development is constantly changing, and new languages, technologies, and tools are emerging to help developers create engaging and functional web applications. Despite these additions, some basic concepts remain the same no matter what kind of development we are talking about, what language we’re using, or what platform we’re working on. Two of
7 min read
How can one become good at Data structures and Algorithms easily?
Let us first clarify the question. There is not any easy way to become good at anything but there is an efficient way to do everything. Let us try to understand the difference between easy and efficient here with the help of a programming question! Consider the problem of "Searching an element in a sorted array". Person A solves the above problem b
4 min read
Walk-Through DSA3 : Data Structures and Algorithms Online Course by GeeksforGeeks
This is a 10 weeks long online certification program specializing in Data Structures & Algorithms which includes pre-recorded premium Video lectures & programming questions for practice. You will learn algorithmic techniques for solving various computational problems and will implement more than 200 algorithmic coding problems. This course
5 min read
Why companies like Amazon, Microsoft, Google focuses on Data Structures and Algorithms : Answered
If you're preparing for a tech interview of any big tech company like Adobe, Amazon, Microsoft, Google, etc. - most probably, you would have known about the importance of Data Structures and Algorithms to crack these interviews. Yes, most of the interviews for technical roles in these companies are focused on measuring the Data Structures and Algor
7 min read
Live Classes for Data Structures and Algorithms: Interview Preparation Focused Course
Engineers have the power to change the world by solving real-world problems but underneath its DSA that plays a crucial role in solving all the problems we are surrounded with. These all are the reasons people from all age groups love to move towards programming and want to learn it. Also, all the major tech companies (Google, Microsoft, Amazon, Fa
4 min read
Best Data Structures and Algorithms Books
Data Structures and Algorithms is one of the most important skills that every Computer Science student must have. There are a number of remarkable publications on DSA in the market, with different difficulty levels, learning approaches and programming languages. In this article we're going to discuss a summary of top 10 Best Data Structures and Alg
9 min read
Is Data Structures and Algorithms Required for Android Development?
Android development is a rapidly evolving field, with new technologies and tools constantly emerging. One question that often arises is whether a solid understanding of data structures and algorithms is necessary for Android developers. In this article, we will explore the importance of data structures and algorithms in software development, their
4 min read
Understanding "Efficiency" when working with Data Structures and Algorithms
What is Efficient Programming?Efficient programming is programming in a manner that, when the program is executed, uses a low amount of overall resources pertaining to computer hardware.  Practicing to create a small file size and low resource algorithm results in an efficient program. Below are some important concepts you should know to understand
8 min read
Learn DSA with Python | Python Data Structures and Algorithms
This tutorial is a beginner-friendly guide for learning data structures and algorithms using Python. In this article, we will discuss the in-built data structures such as lists, tuples, dictionaries, etc, and some user-defined data structures such as linked lists, trees, graphs, etc, and traversal as well as searching and sorting algorithms with th
15+ min read
What to do if I get stuck in Data Structures and Algorithms (DSA)?
Learning Data Structures and Algorithms is like a big adventure where you explore various techniques that tell us how to solve complex problems in computer science. It's like solving a puzzle where you might not be sure what piece goes where. Thus there are times when you might feel stuck while learning DSA. This blog will help to overcome those di
4 min read
Why Every Developer Should Learn Data Structures and Algorithms?
Software developers are regarded as the unknown heroes who design, execute, deploy and manage software programs. It is indeed a lucrative career option that promises insanely high salaries, amazing career growth, and global opportunities. As per the survey software development will witness an amazing growth rate of 19% which is far more than the av
7 min read
Why Data Structures and Algorithms Are Important to Learn?
Array, Linked List, Stack, Queues, Searching, Sorting, Tree, Graph... Do you have questions about why should I study all the above-complicated stuff if it has absolutely no use in real life?? Why do companies ask questions related to data structures and algorithms if it's not useful in a daily job?? A lot of beginners and experienced programmers av
9 min read
Data Structures and Algorithms (DSA) MCQ Quiz Online
Welcome to our Data Structures and Algorithms (DSA) MCQ Quiz Online! This DSA MCQ is all about Quizzes for solving problems and learning the fundamentals of Algorithms and Data Structures. You'll see multiple-choice questions (MCQs) that test how well you understand the basics and Data structure Algorithms. We'll cover every topic of DSA like Array
4 min read
Data Structures and Algorithms Complete Guide using C++
C++ is and will be one of the most demanding programming languages, which is used by over 4 million programmers worldwide. Also, it offers the highest-paying jobs with an average base pay of $103,035 per year. C++ is best known for its reliability, performance, and efficiency. Its usage is extended widely in industries and can be found in video gam
6 min read
three90RightbarBannerImg