3.28.txt

来自「数据结构实验 如下: Status Fibonacci(int k, int」· 文本 代码 · 共 31 行

TXT
31
字号
Status InitCLQueue(CLQueue &rear)
{ 
    rear=(LNode *)malloc(sizeof(LNode));
    if(!rear) return OVERFLOW;
    else rear->next=rear;
    return OK;
}

Status EnCLQueue(CLQueue &rear, ElemType x)
{ 
    LNode *p;
    p=(LNode *)malloc(sizeof(LNode));
    if(!p) return ERROR;
    p->data=x;
    p->next=rear->next;
    rear->next=p;
    rear=p;
    return OK;
}

Status DeCLQueue(CLQueue &rear, ElemType &x)
{    
    LNode * p;
    if(rear->next==rear) return ERROR;
    p=rear->next->next;
    rear->next->next=p->next;
    x=p->data;
    free(p);
    return OK;
}

⌨️ 快捷键说明

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