voidcQueueAppendTail(CQueue* obj, int value) { obj->data[obj->top] = value; obj->top++; }
intcQueueDeleteHead(CQueue* obj) { int value,i; if( obj->top == 0 ) value = -1; else { value = obj->data[0]; for( i = 0;i < obj->top;i++ ) obj->data[i] = obj->data[i+1]; obj->top--; } return value; }
voidcQueueFree(CQueue* obj) { free(obj); }
/** * Your CQueue struct will be instantiated and called as such: * CQueue* obj = cQueueCreate(); * cQueueAppendTail(obj, value); * int param_2 = cQueueDeleteHead(obj); * cQueueFree(obj); */
/** * Your MinStack struct will be instantiated and called as such: * MinStack* obj = minStackCreate(); * minStackPush(obj, x); * minStackPop(obj); * int param_3 = minStackTop(obj); * int param_4 = minStackMin(obj); * minStackFree(obj); */