Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction @BackToBackSWE
Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction  @BackToBackSWE
Uploaded March 2019 | Updated November 2026, 1 hour ago
Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
πŸ“Ή Intuitive Video Explanations
πŸƒ Run Code As You Learn
πŸ’Ύ Save Progress
❓New Unseen Questions
πŸ”Ž Get All Solutions

Question: There are 2 versions.

Version 1: Every row is sorted left to right in non-decreasing order. The first integer of each row is greater or equal to the last integer of the previous row.

Version 2: Every row is sorted left to right in non-decreasing order. Every column is sorted top to bottom in non-decreasing order. There are no guarantees that the first item of any row or column relates to the last item in the previous row or column.

Sorted. Binary search is very likely. Investigate, how do we reduce our decision space?

Our first answer does not need to be logarithmic (it is so crucial you understand logarithms and what they mean....you need to know your complexities to refine answers and notice avenues to better solutions).

The key to search problems is that you notice the fundamental decision we can make to reduce the problem.

...more notes I wrote...

++++++++++++++++++++++++++++++++++++++++++++++++++

HackerRank: youtube.com/channel/UCOf7UPMHBjAavgD0Qw5q5ww

Tuschar Roy: youtube.com/user/tusharroy2525

GeeksForGeeks: youtube.com/channel/UC0RhatS1pyxInC00YKjjBqQ

Jarvis Johnson: youtube.com/user/VSympathyV

Success In Tech: youtube.com/channel/UC-vYrOAmtrx9sBzJAf3x_xw
Search A 2D Sorted Matrix - Fundamentals of Search Space ReductionHow To Permute A String - Generate All Permutations Of A StringMerge 2 Sorted Lists - A Fundamental Merge Sort Subroutine (Merge Two Sorted Lists on LeetCode)Count Total Unique Binary Search Trees - The nth Catalan Number (Dynamic Programming)Coding Interview | QuickSort Overview #shorts #datastructures #codinginterviewWhat is Hashing? | Hashtables Explained #datastructures #hashtableIntroducing Asymptotic NotationsImplement A Sudoku Solver - Sudoku Solving Backtracking Algorithm (Sudoku Solver on LeetCode)The IP Address Decomposition Problem - Compute All Valid IP Addresses From Raw IP StringDijkstras Algorithm vs Prims AlgorithmTest If A Binary Tree Is Height Balanced (Balanced Binary Tree on LeetCode)Deeply Understanding Logarithms In Time Complexities & Their Role In Computer Science
Back To Back SWE |

Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER