-
- The Two Pointers pattern involves using two pointers to iterate through an array or list, often used to find pairs or elements that meet specific criteria.
-
- Prefix Sum involves preprocessing an array to create a new array where each element at index i represents the sum of the array from the start up to i. This allows for efficient sum queries on subarrays.
-
- The Sliding Window pattern is used to find a subarray or substring that satisfies a specific condition, optimizing the time complexity by maintaining a window of elements.
-
- The Fast & Slow Pointers (Tortoise and Hare) pattern is used to detect cycles in linked lists and other similar structures.
-
- The Top 'K' Elements pattern finds the top k largest or smallest elements in an array or stream of data using heaps or sorting.
-
- The Overlapping Intervals pattern is used to merge or handle overlapping intervals in an array.
-
- The Modified Binary Search pattern adapts binary search to solve a wider range of problems, such as finding elements in rotated sorted arrays.
- Use this pattern for problems involving sorted or rotated arrays where you need to find a specific element.
-
- The Monotonic Stack pattern uses a stack to maintain a sequence of elements in a specific order (increasing or decreasing).
- Use this pattern for problems that require finding the next greater or smaller element.
-
- The Monotonic Queue pattern uses a queue to maintain a sequence of elements in a specific order (increasing or decreasing).
-
- The In-place Reversal of a LinkedList pattern reverses parts of a linked list without using extra space.
-
- This approach is quite useful when dealing with the problems where we are given a set of elements such that we can divide them into two parts.
-
-
Dynamic Programming (DP) involves breaking down problems into smaller subproblems and solving them using a bottom-up or top-down approach.
-
Use this pattern for problems with overlapping subproblems and optimal substructure.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
My Leetcode Solutions
papilo-cloud/leetcode
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
My Leetcode Solutions
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published