Question: In C; lets say i have a char array that has . Please help me solve this with the following requirments...the code follows stack
In C; lets say i have a char array that has ". Please help me solve this with the following requirments...the code follows stack method ( Last in, First out) ...assume the functions are built in for this example:
1) If the charaters are between "<" and ">"...you have to call push(char *s ) function (that accepts strings) on those specific characters ....For example the first "Hi" is between "<" and ">"...so "Hi" should be sent into push(char *s) function. After that the other character between "<" and ">" is "Hello" so the function push(char *s) should be used on "Hello" and so on.
Note: You dont need to write the function push(char *s)...pretend it works...if you want to know how it works..its the same as stack.every time something is pushed it goes on top and if pop() is called that top element is then removed.
2) if the character are between "<" , "/" and ">"...then call the Pop() function (that accepts no parameters) on the character...For example should be the first time pop() function should be invoked...and there should be no trace of "Bye" left in the array and then the next element that should be popped is "Hello" and then "Hi".
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
