menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Search a 2...
source image

Prodevelopertutorial

1w

read

320

img
dot

Search a 2D Matrix in C++

  • To search for a value in a 2D matrix, there are two efficient algorithms.
  • The first algorithm involves eliminating one row or column at a time based on the comparison between the target value and the top right element of the current array.
  • The second algorithm treats the matrix as a sorted array and applies binary search to find the target value.
  • Both algorithms have their own advantages and can be used based on the specific requirements.

Read Full Article

like

19 Likes

For uninterrupted reading, download the app