• 2022-06-06
    若一个栈以数组A[1...n]存储,初始化栈顶指针为n+1,则下面x元素入栈的正确代码是( )
    A: A[top] = x; top = top - 1;
    B: A[top] = x; top = top + 1;
    C: top = top -1; A[top] = x;
    D: top = top +1; A[top] = x;