In this article, we have explored an insightful approach/ algorithm to find the number of islands in MxN matrix. An extension of this algorithm is used by online battleship game engine.
TABLE OF CONTENTSPROBLEM STATEMENT DEFINITIONPROBLEM ANALYSISSOLUTION ANALYSISMETHOD-1 BREADTH-FIRST-SEARCH APPROACHAlgorithmImplementationComplexityMETHOD-2 DEPTH-FIRST-SEARCH WHILE UPDATING MATRIX APPROACHAlgorithmImplementationComplexityMETHOD-3 DEPTH-FIRST-SEARCH WHILE UPDATING MATRIX APPRO...
Published on October 31, 2021 03:49