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

📄 3.19.txt

📁 数据结构实验 如下: Status Fibonacci(int k, int m, int &f) /* 求k阶斐波那契序列的第m项的值f */
💻 TXT
字号:
Status MatchCheck(SqList exp)
/* 顺序表exp表示表达式;                        */
/* 若exp中的括号配对,则返回TRUE,否则返回FALSE */
{
    int i;
    Stack s;
    ElemType c,d;
    InitStack(s); 
    for(i=0;i<exp.length;i++){
        c=exp.elem[i];
        if(c=='('||c=='['||c=='{') 
            Push(s,c);
        else if(c==')'){
           if(!Pop(s,d)||d!='(') return FALSE;
        } 
        else if(c==']'){
           if(!Pop(s,d)||d!='[') return FALSE;
        }
        else if(c=='}'){
           if(!Pop(s,d)||d!='{') return FALSE;
        }     
    }
    if(StackEmpty(s)) return TRUE;
    else return FALSE;
}

⌨️ 快捷键说明

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