How can I use ADT to complete a function takes in a string
parameter (char array) that contains one or more sentences;
each sentence is terminated by the full-stop ('.') or the
NULL character. When the function returns, the characters in
each of the functions are reversed in order, and also all
numeric digit characters are discarded. The function should
also return the number of sentences in str as the return
value.
ie, if str is "ABC D2EF. GHI3J. KLM", then after calling the function str
becomes "FED CBA. JIHG. MLK". The function should also return 3, indicating that there
are 3 sentences.
Code:#include <stdio.h> #define STACKSIZE 1024 char stack[STACKSIZE]; int stackptr = 0; void push(char ch) { /* pushes the character ch onto the stack */ if (stackptr == STACKSIZE) return; stack[stackptr++] = ch; } char pop() { /* pops and returns the top character */ if (stackptr == 0) return '\0'; return stack[--stackptr]; } int isEmpty() { /* return 1 if the stack is empty, 0 otherwise */ return (stackptr == 0); } int reverseSentence(char str[]) { }