What are the common algorithms for LeetCode?

LeetCode challenges cover a wide range of algorithmic concepts. Preparing for these challenges often involves familiarizing yourself with some common algorithms. Here's a list of key algorithms often encountered in LeetCode problems:

1. Sorting Algorithms

  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Insertion Sort
  • Radix Sort

2. Search Algorithms

  • Binary Search
  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • Linear Search

3. Dynamic Programming

  • Memoization
  • Tabulation
  • Divide and Conquer

4. Recursion

  • Basic Recursion
  • Backtracking (e.g., solving puzzles like Sudoku, N-Queens problem)

5. Graph Algorithms

  • Dijkstra's Algorithm (Shortest Path)
  • Bellman-Ford Algorithm
  • Floyd-Warshall Algorithm
  • Topological Sort
  • Kruskal’s and Prim’s Algorithms (Minimum Spanning Tree)

6. Tree Algorithms

  • Tree Traversal (Inorder, Preorder, Postorder)
  • Binary Search Trees
  • AVL Trees
  • Segment Trees
  • Fenwick Trees or Binary Indexed Trees

7. Greedy Algorithms

  • Activity Selection
  • Huffman Coding
  • Prim’s and Kruskal’s Algorithms

8. String Manipulation Algorithms

  • String Matching and Parsing
  • KMP Algorithm (Knuth Morris Pratt)
  • Rabin-Karp Algorithm
  • Trie (Prefix Tree) Implementation

9. Bit Manipulation Techniques

  • Basic Bit Operations
  • Bitmasking Techniques
  • Brian Kernighan’s Algorithm

10. Data Structures

  • Arrays and Linked Lists
  • Stacks and Queues
  • Hash Tables
  • Heaps

Conclusion

This list is not exhaustive but covers many of the fundamental algorithms that are often used to solve problems on LeetCode. A solid understanding of these algorithms, along with strong problem-solving skills, will be immensely beneficial in tackling LeetCode challenges effectively.

TAGS
Data Structures and Algorithms
Dynamic Programming Patterns
Coding Interview Questions
Coding Interview
Coding Patterns
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
Can I be a software engineer from home?
How many bullet points per job on CV?
What does GPT stand for?
Who is the youngest person to pass CCNA?
What is portfolio in tech?
Where is Netflix's headquarters?
Related Courses
Course image
Grokking the Coding Interview: Patterns for Coding Questions
Grokking the Coding Interview Patterns in Java, Python, JS, C++, C#, and Go. The most comprehensive course with 476 Lessons.
4.6
Discounted price for Your Region

$197

Course image
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
3.9
Discounted price for Your Region

$78

Course image
Grokking Data Structures & Algorithms for Coding Interviews
Unlock Coding Interview Success: Dive Deep into Data Structures and Algorithms.
4
Discounted price for Your Region

$78

Image
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.