coding_patterns_brief Flashcards
Sliding Window
Handle input data in a specific window size
Islands (Matrix Traversal) /Matrices
Matrix Traversing (2D Array)
Two Pointers
iterate input data , pointers move in opposite direction
Fast & Slow Pointers
Two Pointers to traverse the input data at different speeds
Merge Intervals
Overlaping Intervals
Cyclic Sort
Solve array problems where the input datra lies within a fixed range
In-place Reversal of a LinkedList
reverse a linkedlist without using extra memory
Tree Breadth-First Search
traverse a tree, each level fully
Tree Depth First Search
traverse a tree, going down child nodes until the end and then go back up
Two Heaps
In many problems, we are given a set of elements that can be divided into two parts. We are interested in knowing the smallest element in one part and the biggest element in the other part. Uses a Min-Heap to find the smallest element and a Max Heap to find the biggest element
Subsets
Permutations or Combinations of a set elements
Modified Binary Search
Search a sorted set of elements efficiently
Bitwise XOR / Bitwise Manipulation
Bit manipulations
Top ‘K’ Elements
Find the top/smallest/frequent ‘K’ elements in a set
K-way Merge
Solve problems that involve a list of sorted array