以下算法用于在矩阵中查找盆地。整题如下:2-Dmatrixisgivenwhereeachcellrepresentsheightofcell.Watercanflowfromcellwithhigherheighttolowerone.Abasiniswhenthereisnocellwithlowerheightintheneighbours(left,right,up,down,diagonal).Youhavetofindmaximumsizebasinblock.我已经实现了代码。我正在寻找时间复杂度。在我看来,时间复杂度是O(n*m),其中n和m是矩阵的行和列。请验证。pu