/* START: fig3_50.txt */ void Push( ElementType X, Stack S ) { if( IsFullStack( S ) ) Error( "Full stack" ); else S->Array[ ++S->TopOfStack ] = X; }
void Push(TreeStack *S, struct BinaryTreeNode *node) { if(IsFullStack(S)) { printf("Stack Overflow\n"); }else{ S -> array[++S -> top] = node; //printf("<PUSH>\n"); //DebugS(S); } }
//************************************************************** int PushStack ( MyStack* Stack, double Data ) { if ( IsFullStack ( Stack ) == -1 ) return -1; ( Stack->Head )++; if ( IsStackValid ( Stack ) == -1 ) return -1; Stack->Data[Stack->Head] = Data; errno = 0; return 0; }
void Push(BinaryTreeNodeStack *S, BinaryTreeNode *node) { if(IsFullStack(S)) DoubleBinaryTreeNodeStack(S); S -> array[++S -> top] = node; }
void Push(int data, ArrayStack* s){if(!IsFullStack(s)) s->Array[++s->top]=data; else DoubleStack(s);}