下面的程序属于哪种算法( )。
1 int pos[8]; 2 void queen(int n) { 3 for (int i = 0; i < 8; i++) { 4 pos[n] = i; 5 bool attacked = false; 6 for (int j = 0; j < n; j++) 7 if (pos[n] == pos[j] || pos[n] + n == pos[j] + j || pos[n] - n == pos[j]- j) { 8 attacked = true; 9 break; 10 } 11 if (attacked) 12 continue; 13 if (n == 7) { 14 return; 15 } else { 16 queen(n + 1); 17 } 18 } 19 }