General framework of dfs

void DFS () 
{ 
    IF (Midpoint state) 
    { 
        ... // Add meaning of the questions 
        return ; 
    } 
    IF (not legal bounds or state) return ; 
     IF (special state) // pruning 
         return ;
     for (extended mode ) 
    { 
        IF (expanded state legal manner arrival) 
        { 
            modify operation; // add meaning of the questions 
            marks; 
            DFS (); 
            (marked reduction); 
            // if the meaning of the questions marks plus reducing
             // If the flag is restored plus backtracking 
        } 
    } 
}

 

Guess you like

Origin www.cnblogs.com/lovezxy520/p/11391891.html
Recommended