Answered step by step
Verified Expert Solution
Question
1 Approved Answer
prog1 2 and typedefs typedef struct stack( Create a header file (prog1_2.h) which will contain the following function prototypes int* data; int size; int capacity:
prog1 2 and typedefs typedef struct stack( Create a header file (prog1_2.h) which will contain the following function prototypes int* data; int size; int capacity: STACK STACK* MakeStack (int initialCapacity); void Push (STACK *stackPtr,int data) int Pop (STACK stackPtr) void Grow (STACK *stackPtr) Create a source file (prog1_2.c) that will implement the MakeStack, Push, Pop and Grow functionality. The STACK that is produced by the MakeStack function should be able to hold initialCapacity integers. The Grow function should double a stacks capacity without changing any of the values held by the STACK. The Push and Pop functions should work as expected for a stack. The Push function should Grow the stack if there isn't enough capacity to hold the pushed data. The Pop function should return -1 if there is no data in the STACK. Yes, this is probably incorrect behavior
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started