排列数字(深度优先搜索) C++实现

题目

排列数字(深度优先搜索) C++实现_第1张图片代码

#include
using namespace std;
const int N=1010;
int path[N],n;
bool flag[N];

void dfs(int u){
    if(u==n){
        for(int i=0;i

你可能感兴趣的:(c++,算法,深度优先)