⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 9.26.txt

📁 数据结构实验 如下: Status Fibonacci(int k, int m, int &f) /* 求k阶斐波那契序列的第m项的值f */
💻 TXT
字号:
Status IsBSTree(BiTree t)
/* 判别给定二叉树t是否为二叉排序树。*/
/* 若是,则返回TRUE,否则FALSE      */
{
    BiTree p,Q[50];                       //Q和j构成栈
    int j = 0,ans = TRUE;
    Q[j++] = t;
    while(j > 0 && ans){
        p = Q[--j];
        if(p->lchild != NULL){
            Q[j++] = p->lchild;
            if(p->data.key < p->lchild->data.key)
                ans = FALSE;                
        }
        if(p->rchild != NULL){
            Q[j++] = p->rchild;
            if(p->data.key > p->rchild->data.key)
                ans = FALSE;                
        }        
    }
    return ans;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -