閱讀63 返回首頁    go 阿裏雲 go 技術社區[雲棲]


[算法係列之二]二叉樹各種遍曆

【簡介】

樹形結構是一類重要的非線性數據結構,其中以樹和二叉樹最為常用。

二叉樹是每個結點最多有兩個子樹的有序樹。通常子樹的根被稱作“左子樹”(left subtree)和“右子樹”(right subtree)。二叉樹常被用作二叉查找樹和二叉堆或是二叉排序樹。二叉樹的每個結點至多隻有二棵子樹(不存在度大於2的結點),二叉樹的子樹有左右之分,次序不能顛倒。二叉樹的第i層至多有2的 i -1次方個結點;深度為k的二叉樹至多有2^(k) -1個結點;對任何一棵二叉樹T,如果其終端結點數(即葉子結點數)為n0,度為2的結點數為n2,則n0 = n2 + 1。

二叉樹的鏈式存儲結構是一類重要的數據結構,其形式定義如下:

  1. //二叉樹結點  
  2. typedef struct BiTNode{  
  3.     //數據  
  4.     char data;  
  5.     //左右孩子指針  
  6.     struct BiTNode *lchild,*rchild;  
  7. }BiTNode,*BiTree;  

或者


// 二叉樹節點結構
struct TreeNode{
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x):val(x),left(nullptr),right(nullptr){}
};

【二叉樹的創建】

通過讀入一個字符串,建立二叉樹的算法如下:

  1. //按先序序列創建二叉樹  
  2. int CreateBiTree(BiTree &T){  
  3.     char data;  
  4.     //按先序次序輸入二叉樹中結點的值(一個字符),‘#’表示空樹  
  5.     scanf("%c",&data);  
  6.     if(data == '#'){  
  7.         T = NULL;  
  8.     }  
  9.     else{  
  10.         T = (BiTree)malloc(sizeof(BiTNode));  
  11.         //生成根結點  
  12.         T->data = data;  
  13.         //構造左子樹  
  14.         CreateBiTree(T->lchild);  
  15.         //構造右子樹  
  16.         CreateBiTree(T->rchild);  
  17.     }  
  18.     return 0;  
  19. }  


或者


// 1.創建二叉樹
void CreateTree(TreeNode* &root){
    int val;
    //按先序次序輸入二叉樹中結點的值,‘-1’表示空樹
    cin>>val;
    // 空節點
    if(val == -1){
        root = nullptr;
        return;
    }//if
    root = new TreeNode(val);
    //構造左子樹
    CreateTree(root->left);
    //構造右子樹
    CreateTree(root->right);
}


層次建立二叉樹:

struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};


// 創建二叉樹
TreeNode* CreateTreeByLevel(vector<char> num){
    int len = num.size();
    if(len == 0){
        return NULL;
    }//if
    queue<TreeNode*> queue;
    int index = 0;
    // 創建根節點
    TreeNode *root = new TreeNode(num[index++]);
    // 入隊列
    queue.push(root);
    TreeNode *p = NULL;
    while(!queue.empty() && index < len){
        // 出隊列
        p = queue.front();
        queue.pop();
        // 左節點
        if(index < len && num[index] != -1){
            // 如果不空創建一個節點
            TreeNode *leftNode = new TreeNode(num[index]);
            p->left = leftNode;
            queue.push(leftNode);
        }
        index++;
        // 右節點
        if(index < len && num[index] != -1){
            // 如果不空創建一個節點
            TreeNode *rightNode = new TreeNode(num[index]);
            p->right = rightNode;
            queue.push(rightNode);
        }
        index++;
    }//while
    return root;
}

-1代表NULL


創建如上二叉樹輸入:

15 11 20 8 14 -1 -1 -1 -1 13 -1

【二叉樹的遍曆】

遍曆是對樹的一種最基本的運算,所謂遍曆二叉樹,就是按一定的規則和順序走遍二叉樹的所有結點,使每一個結點都被訪問一次,而且隻被訪問一次。由於二叉樹是非線性結構,因此,樹的遍曆實質上是將二叉樹的各個結點轉換成為一個線性序列來表示。

【遞歸算法】

  1. //輸出  
  2. void Visit(BiTree T){  
  3.     if(T->data != '#'){  
  4.         printf("%c ",T->data);  
  5.     }  
  6. }  
  7. //先序遍曆  
  8. void PreOrder(BiTree T){  
  9.     if(T != NULL){  
  10.         //訪問根節點  
  11.         Visit(T);  
  12.         //訪問左子結點  
  13.         PreOrder(T->lchild);  
  14.         //訪問右子結點  
  15.         PreOrder(T->rchild);  
  16.     }  
  17. }  
  18. //中序遍曆  
  19. void InOrder(BiTree T){  
  20.     if(T != NULL){  
  21.         //訪問左子結點  
  22.         InOrder(T->lchild);  
  23.         //訪問根節點  
  24.         Visit(T);  
  25.         //訪問右子結點  
  26.         InOrder(T->rchild);  
  27.     }  
  28. }  
  29. //後序遍曆  
  30. void PostOrder(BiTree T){  
  31.     if(T != NULL){  
  32.         //訪問左子結點  
  33.         PostOrder(T->lchild);  
  34.         //訪問右子結點  
  35.         PostOrder(T->rchild);  
  36.         //訪問根節點  
  37.         Visit(T);  
  38.     }  
  39. }  

【非遞歸算法】
【先序遍曆】

【思路】:訪問T->data後,將T入棧,遍曆左子樹;遍曆完左子樹返回時,棧頂元素應為T,出棧,再先序遍曆T的右子樹。

  1. /* 先序遍曆(非遞歸) 
  2.    思路:訪問T->data後,將T入棧,遍曆左子樹;遍曆完左子樹返回時,棧頂元素應為T,出棧,再先序遍曆T的右子樹。 
  3. */  
  4. void PreOrder2(BiTree T){  
  5.     stack<BiTree> stack;  
  6.     //p是遍曆指針  
  7.     BiTree p = T;  
  8.     //棧不空或者p不空時循環  
  9.     while(p || !stack.empty()){  
  10.         if(p != NULL){  
  11.             //存入棧中  
  12.             stack.push(p);  
  13.             //訪問根節點  
  14.             printf("%c ",p->data);  
  15.             //遍曆左子樹  
  16.             p = p->lchild;  
  17.         }  
  18.         else{  
  19.             //退棧  
  20.             p = stack.top();  
  21.             stack.pop();  
  22.             //訪問右子樹  
  23.             p = p->rchild;  
  24.         }  
  25.     }//while  
  26. }  


// 先序遍曆
void PreOrder(TreeNode* root){
    if(root == NULL){
        return;
    }
    stack<TreeNode*> stack;
    stack.push(root);
    TreeNode *p = NULL;
    while(!stack.empty()){
        p = stack.top();
        stack.pop();
        cout<<p->val<<endl;
        // 右子節點不空壓入棧中
        if(p->right){
            stack.push(p->right);
        }
        // 左子節點不空壓入棧中
        if(p->left){
            stack.push(p->left);
        }
    }//while
}



【中序遍曆】

【思路】:T是要遍曆樹的根指針,中序遍曆要求在遍曆完左子樹後,訪問根,再遍曆右子樹。
         先將T入棧,遍曆左子樹;遍曆完左子樹返回時,棧頂元素應為T,出棧,訪問T->data,再中序遍曆T的右子樹。

  1. void InOrder2(BiTree T){  
  2.     stack<BiTree> stack;  
  3.     //p是遍曆指針  
  4.     BiTree p = T;  
  5.     //棧不空或者p不空時循環  
  6.     while(p || !stack.empty()){  
  7.         if(p != NULL){  
  8.             //存入棧中  
  9.             stack.push(p);  
  10.             //遍曆左子樹  
  11.             p = p->lchild;  
  12.         }  
  13.         else{  
  14.             //退棧,訪問根節點  
  15.             p = stack.top();  
  16.             printf("%c ",p->data);  
  17.             stack.pop();  
  18.             //訪問右子樹  
  19.             p = p->rchild;  
  20.         }  
  21.     }//while  
  22. }  

【後序遍曆】

【思路】:T是要遍曆樹的根指針,後序遍曆要求在遍曆完左右子樹後,再訪問根。需要判斷根結點的左右子樹是否均遍曆過。

  1. //後序遍曆(非遞歸)  
  2. typedef struct BiTNodePost{  
  3.     BiTree biTree;  
  4.     char tag;  
  5. }BiTNodePost,*BiTreePost;  
  6.   
  7. void PostOrder2(BiTree T){  
  8.     stack<BiTreePost> stack;  
  9.     //p是遍曆指針  
  10.     BiTree p = T;  
  11.     BiTreePost BT;  
  12.     //棧不空或者p不空時循環  
  13.     while(p != NULL || !stack.empty()){  
  14.         //遍曆左子樹  
  15.         while(p != NULL){  
  16.             BT = (BiTreePost)malloc(sizeof(BiTNodePost));  
  17.             BT->biTree = p;  
  18.             //訪問過左子樹  
  19.             BT->tag = 'L';  
  20.             stack.push(BT);  
  21.             p = p->lchild;  
  22.         }  
  23.         //左右子樹訪問完畢訪問根節點  
  24.         while(!stack.empty() && (stack.top())->tag == 'R'){  
  25.             BT = stack.top();  
  26.             //退棧  
  27.             stack.pop();   
  28.             printf("%c ",BT->biTree->data);  
  29.         }  
  30.         //遍曆右子樹  
  31.         if(!stack.empty()){  
  32.             BT = stack.top();  
  33.             //訪問過右子樹  
  34.             BT->tag = 'R';  
  35.             p = BT->biTree;  
  36.             p = p->rchild;  
  37.         }  
  38.     }//while  
  39. }  

或者


    vector<int> postorderTraversal(TreeNode *root) {
        vector<int> result;
        if(root == nullptr){
            return result;
        }//if
        stack<TreeNode*> s;
        s.push(root);
        TreeNode *node;
        while(!s.empty()){
            node = s.top();
            s.pop();
            result.insert(result.begin(),node->val);
            // 左子樹
            if(node->left){
                s.push(node->left);
            }//if
            // 右子樹
            if(node->right){
                s.push(node->right);
            }//if
        }//while
        return result;
    }

【層次遍曆】

【思路】:按從頂向下,從左至右的順序來逐層訪問每個節點,層次遍曆的過程中需要用隊列。

  1. //層次遍曆  
  2. void LevelOrder(BiTree T){  
  3.     BiTree p = T;  
  4.     //隊列  
  5.     queue<BiTree> queue;  
  6.     //根節點入隊  
  7.     queue.push(p);  
  8.     //隊列不空循環  
  9.     while(!queue.empty()){  
  10.         //對頭元素出隊  
  11.         p = queue.front();  
  12.         //訪問p指向的結點  
  13.         printf("%c ",p->data);  
  14.         //退出隊列  
  15.         queue.pop();  
  16.         //左子樹不空,將左子樹入隊  
  17.         if(p->lchild != NULL){  
  18.             queue.push(p->lchild);  
  19.         }  
  20.         //右子樹不空,將右子樹入隊  
  21.         if(p->rchild != NULL){  
  22.             queue.push(p->rchild);  
  23.         }  
  24.     }  
  25. }  


【測試】



輸入:(先序)

15 11 8 -1 -1 14 13 -1 -1 -1 20 -1 -1

輸出:



代碼一:


    /*-------------------------------------
    *   日期:2015-03-25
    *   作者:SJF0115
    *   題目: 二叉樹各種遍曆
    *   來源:
    *   博客:
    ------------------------------------*/
    #include <iostream>
    #include <vector>
    #include <stack>
    #include <queue>
    using namespace std;

    // 二叉樹節點結構
    struct TreeNode{
        int val;
        TreeNode *left;
        TreeNode *right;
        TreeNode(int x):val(x),left(nullptr),right(nullptr){}
    };
    // 1.創建二叉樹
    void CreateTree(TreeNode* &root){
        int val;
        //按先序次序輸入二叉樹中結點的值,‘-1’表示空樹
        cin>>val;
        // 空節點
        if(val == -1){
            root = nullptr;
            return;
        }//if
        root = new TreeNode(val);
        //構造左子樹
        CreateTree(root->left);
        //構造右子樹
        CreateTree(root->right);
    }
    // 2.1 遞歸先序遍曆
    void PreOrder(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        result.push_back(root->val);
        // 左子樹
        PreOrder(root->left,result);
        // 右子樹
        PreOrder(root->right,result);
    }
    // 2.2 非遞歸先序遍曆
    void PreOrder2(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        stack<TreeNode*> s;
        s.push(root);
        TreeNode *node;
        while(!s.empty()){
            node = s.top();
            s.pop();
            result.push_back(node->val);
            // 右子樹
            if(node->right){
                s.push(node->right);
            }//if
            // 左子樹
            if(node->left){
                s.push(node->left);
            }//if
        }//while
    }
    // 3.1 遞歸中序遍曆
    void InOrder(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        // 左子樹
        InOrder(root->left,result);
        result.push_back(root->val);
        // 右子樹
        InOrder(root->right,result);
    }
    // 3.2 非遞歸中序遍曆
    void InOrder2(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        stack<TreeNode*> s;
        TreeNode *node = root;
        while(node != nullptr || !s.empty()){
            // 左子樹
            if(node != nullptr){
                s.push(node);
                node = node->left;
            }//if
            // 右子樹
            else{
                node = s.top();
                s.pop();
                result.push_back(node->val);
                node = node->right;
            }
        }//while
    }
    // 4.1 遞歸後序遍曆
    void PostOrder(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        // 左子樹
        PostOrder(root->left,result);
        // 右子樹
        PostOrder(root->right,result);
        result.push_back(root->val);
    }
    // 4.2 非遞歸後序遍曆
    void PostOrder2(TreeNode *root,vector<int> &result) {
        if(root == nullptr){
            return;
        }//if
        stack<TreeNode*> s;
        s.push(root);
        TreeNode *node;
        while(!s.empty()){
            node = s.top();
            s.pop();
            result.insert(result.begin(),node->val);
            // 左子樹
            if(node->left){
                s.push(node->left);
            }//if
            // 右子樹
            if(node->right){
                s.push(node->right);
            }//if
        }//while
    }
    // 5 層次遍曆
    void LevelOrder(TreeNode* root,vector<int> &result){
        if(root == nullptr){
            return;
        }//if
        queue<TreeNode*> queue;
        queue.push(root);
        TreeNode *node;
        while(!queue.empty()){
            node = queue.front();
            queue.pop();
            result.push_back(node->val);
            // 左子樹
            if(node->left){
                queue.push(node->left);
            }//if
            // 右子樹
            if(node->right){
                queue.push(node->right);
            }//if
        }//while
    }
    // 輸出結果
    void Print(vector<int> result){
        int size = result.size();
        for(int i = 0;i < size;++i){
            cout<<result[i]<<" ";
        }//for
        cout<<endl;
    }
    int main(){
        freopen("C:\\Users\\Administrator\\Desktop\\c++.txt", "r", stdin);
        TreeNode* root = nullptr;
        vector<int> result;
        // 創建二叉樹
        cout<<"1. 創建二叉樹"<<endl;
        CreateTree(root);
        cout<<"-----------------------------"<<endl;

        cout<<"2.1 遞歸先序遍曆"<<endl;
        PreOrder(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"2.2 非遞歸先序遍曆"<<endl;
        PreOrder2(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"3.1 遞歸中序遍曆"<<endl;
        InOrder(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"3.2 非遞歸中序遍曆"<<endl;
        InOrder2(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"4.1 遞歸後序遍曆"<<endl;
        PostOrder(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"4.2 非遞歸後序遍曆"<<endl;
        PostOrder2(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;

        cout<<"5 層次遍曆"<<endl;
        LevelOrder(root,result);
        Print(result);
        result.clear();
        cout<<"-----------------------------"<<endl;
        return 0;
    }

測試用例:


輸入:

ABC##DE#G##F###

輸出:


代碼二:

  1. #include<iostream>  
  2. #include<stack>  
  3. #include<queue>  
  4. using namespace std;  
  5.   
  6. //二叉樹結點  
  7. typedef struct BiTNode{  
  8.     //數據  
  9.     char data;  
  10.     //左右孩子指針  
  11.     struct BiTNode *lchild,*rchild;  
  12. }BiTNode,*BiTree;  
  13.   
  14. //按先序序列創建二叉樹  
  15. int CreateBiTree(BiTree &T){  
  16.     char data;  
  17.     //按先序次序輸入二叉樹中結點的值(一個字符),‘#’表示空樹  
  18.     scanf("%c",&data);  
  19.     if(data == '#'){  
  20.         T = NULL;  
  21.     }  
  22.     else{  
  23.         T = (BiTree)malloc(sizeof(BiTNode));  
  24.         //生成根結點  
  25.         T->data = data;  
  26.         //構造左子樹  
  27.         CreateBiTree(T->lchild);  
  28.         //構造右子樹  
  29.         CreateBiTree(T->rchild);  
  30.     }  
  31.     return 0;  
  32. }  
  33. //輸出  
  34. void Visit(BiTree T){  
  35.     if(T->data != '#'){  
  36.         printf("%c ",T->data);  
  37.     }  
  38. }  
  39. //先序遍曆  
  40. void PreOrder(BiTree T){  
  41.     if(T != NULL){  
  42.         //訪問根節點  
  43.         Visit(T);  
  44.         //訪問左子結點  
  45.         PreOrder(T->lchild);  
  46.         //訪問右子結點  
  47.         PreOrder(T->rchild);  
  48.     }  
  49. }  
  50. //中序遍曆    
  51. void InOrder(BiTree T){    
  52.     if(T != NULL){    
  53.         //訪問左子結點    
  54.         InOrder(T->lchild);    
  55.         //訪問根節點    
  56.         Visit(T);    
  57.         //訪問右子結點    
  58.         InOrder(T->rchild);    
  59.     }    
  60. }    
  61. //後序遍曆  
  62. void PostOrder(BiTree T){  
  63.     if(T != NULL){  
  64.         //訪問左子結點  
  65.         PostOrder(T->lchild);  
  66.         //訪問右子結點  
  67.         PostOrder(T->rchild);  
  68.         //訪問根節點  
  69.         Visit(T);  
  70.     }  
  71. }  
  72. /* 先序遍曆(非遞歸) 
  73.    思路:訪問T->data後,將T入棧,遍曆左子樹;遍曆完左子樹返回時,棧頂元素應為T,出棧,再先序遍曆T的右子樹。 
  74. */  
  75. void PreOrder2(BiTree T){  
  76.     stack<BiTree> stack;  
  77.     //p是遍曆指針  
  78.     BiTree p = T;  
  79.     //棧不空或者p不空時循環  
  80.     while(p || !stack.empty()){  
  81.         if(p != NULL){  
  82.             //存入棧中  
  83.             stack.push(p);  
  84.             //訪問根節點  
  85.             printf("%c ",p->data);  
  86.             //遍曆左子樹  
  87.             p = p->lchild;  
  88.         }  
  89.         else{  
  90.             //退棧  
  91.             p = stack.top();  
  92.             stack.pop();  
  93.             //訪問右子樹  
  94.             p = p->rchild;  
  95.         }  
  96.     }//while  
  97. }  
  98. /* 中序遍曆(非遞歸) 
  99.    思路:T是要遍曆樹的根指針,中序遍曆要求在遍曆完左子樹後,訪問根,再遍曆右子樹。 
  100.          先將T入棧,遍曆左子樹;遍曆完左子樹返回時,棧頂元素應為T,出棧,訪問T->data,再中序遍曆T的右子樹。 
  101. */  
  102. void InOrder2(BiTree T){  
  103.     stack<BiTree> stack;  
  104.     //p是遍曆指針  
  105.     BiTree p = T;  
  106.     //棧不空或者p不空時循環  
  107.     while(p || !stack.empty()){  
  108.         if(p != NULL){  
  109.             //存入棧中  
  110.             stack.push(p);  
  111.             //遍曆左子樹  
  112.             p = p->lchild;  
  113.         }  
  114.         else{  
  115.             //退棧,訪問根節點  
  116.             p = stack.top();  
  117.             printf("%c ",p->data);  
  118.             stack.pop();  
  119.             //訪問右子樹  
  120.             p = p->rchild;  
  121.         }  
  122.     }//while  
  123. }  
  124.   
  125. //後序遍曆(非遞歸)  
  126. typedef struct BiTNodePost{  
  127.     BiTree biTree;  
  128.     char tag;  
  129. }BiTNodePost,*BiTreePost;  
  130.   
  131. void PostOrder2(BiTree T){  
  132.     stack<BiTreePost> stack;  
  133.     //p是遍曆指針  
  134.     BiTree p = T;  
  135.     BiTreePost BT;  
  136.     //棧不空或者p不空時循環  
  137.     while(p != NULL || !stack.empty()){  
  138.         //遍曆左子樹  
  139.         while(p != NULL){  
  140.             BT = (BiTreePost)malloc(sizeof(BiTNodePost));  
  141.             BT->biTree = p;  
  142.             //訪問過左子樹  
  143.             BT->tag = 'L';  
  144.             stack.push(BT);  
  145.             p = p->lchild;  
  146.         }  
  147.         //左右子樹訪問完畢訪問根節點  
  148.         while(!stack.empty() && (stack.top())->tag == 'R'){  
  149.             BT = stack.top();  
  150.             //退棧  
  151.             stack.pop();  
  152.             BT->biTree;  
  153.             printf("%c ",BT->biTree->data);  
  154.         }  
  155.         //遍曆右子樹  
  156.         if(!stack.empty()){  
  157.             BT = stack.top();  
  158.             //訪問過右子樹  
  159.             BT->tag = 'R';  
  160.             p = BT->biTree;  
  161.             p = p->rchild;  
  162.         }  
  163.     }//while  
  164. }  
  165. //層次遍曆  
  166. void LevelOrder(BiTree T){  
  167.     BiTree p = T;  
  168.     //隊列  
  169.     queue<BiTree> queue;  
  170.     //根節點入隊  
  171.     queue.push(p);  
  172.     //隊列不空循環  
  173.     while(!queue.empty()){  
  174.         //對頭元素出隊  
  175.         p = queue.front();  
  176.         //訪問p指向的結點  
  177.         printf("%c ",p->data);  
  178.         //退出隊列  
  179.         queue.pop();  
  180.         //左子樹不空,將左子樹入隊  
  181.         if(p->lchild != NULL){  
  182.             queue.push(p->lchild);  
  183.         }  
  184.         //右子樹不空,將右子樹入隊  
  185.         if(p->rchild != NULL){  
  186.             queue.push(p->rchild);  
  187.         }  
  188.     }  
  189. }  
  190. int main()  
  191. {  
  192.     BiTree T;  
  193.     CreateBiTree(T);  
  194.     printf("先序遍曆:\n");  
  195.     PreOrder(T);  
  196.     printf("\n");  
  197.     printf("先序遍曆(非遞歸):\n");  
  198.     PreOrder2(T);  
  199.     printf("\n");  
  200.     printf("中序遍曆:\n");  
  201.     InOrder(T);  
  202.     printf("\n");  
  203.     printf("中序遍曆(非遞歸):\n");  
  204.     InOrder2(T);  
  205.     printf("\n");  
  206.     printf("後序遍曆:\n");  
  207.     PostOrder(T);  
  208.     printf("\n");  
  209.     printf("後序遍曆(非遞歸):\n");  
  210.     PostOrder2(T);  
  211.     printf("\n");  
  212.     printf("層次遍曆:\n");  
  213.     LevelOrder(T);  
  214.     printf("\n");  
  215.     return 0;  
  216. }  

最後更新:2017-04-03 12:56:27

  上一篇:go 淺談C#中new、override、virtual關鍵字的區別
  下一篇:go 麵試經之一道淘汰85%麵試者的百度開發者麵試題