dsa1 min read
Search a 2D Matrix II — Staircase Search O(m+n)
Search a row-column sorted 2D matrix in O(m+n) using the staircase technique from top-right corner.
Read →
webcoderspeed.com
2 articles
Search a row-column sorted 2D matrix in O(m+n) using the staircase technique from top-right corner.
Count negatives in a sorted matrix in O(m+n) using the staircase approach or O(m log n) with binary search per row.