MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / f

Method f

CPP/questions/Max Area of Island.cpp:12–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 }
11
12 int f(int i,int j,int n,int m,vector<vector<int>>&grid){
13 grid[i][j] = 0;
14
15 int cnt = 1;
16 if(IsVisit(i+1,j,n,m,grid)){
17 cnt+=f(i+1,j,n,m,grid);
18 }
19 if(IsVisit(i-1,j,n,m,grid)){
20 cnt+=f(i-1,j,n,m,grid);
21 }
22 if(IsVisit(i,j+1,n,m,grid)){
23 cnt+=f(i,j+1,n,m,grid);
24 }
25 if(IsVisit(i,j-1,n,m,grid)){
26 cnt+=f(i,j-1,n,m,grid);
27 }
28 return cnt;
29 }
30
31 int maxAreaOfIsland(vector<vector<int>>& grid){
32 int n = grid.size();

Callers

nothing calls this directly

Calls 1

fFunction · 0.50

Tested by

no test coverage detected