c++實現gray code(格雷碼)

今天別人問的一道題,強調用分治法實現 =。=  百度了一下格雷碼,然後寫了一下。 關於格雷碼大家看百度的吧,特別詳細,貼個圖:   代碼如下(header_file.h是我自己寫的一個頭文件,包括常見的vector iostream等): #include"header_file.h" using namespace std; vector<string> gray_code(int n) {
相關文章
相關標籤/搜索