Depth search template

#include <the iostream>
#include <cstdio>
the using namespace STD;
void DFS (/ * start coordinate * /) {
 IF (/ * find the exit * /) {
  // operations
  return;
 }
 for (/ * loop through all directions * /) {
  IF (/ * new coordinate ineligible * /)
   continue;
  // operating
  DFS (/ * search continues down a new coordinate * /);
  // back
 }
}
int main () {
 // read the data
 dfs (/ * start point coordinates * /);  return 0; }
 

Guess you like

Origin www.cnblogs.com/QingyuYYYYY/p/11618573.html