C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 12, Problem 12.11E
Program Plan Intro

Program plan:

  1. String, ch, k, flag variables are used for input. There is structure stknode having ch, nextval member variables which represent the stack value.
  2. void push(stack **top, char alphabet) function inserts the node in the stack.
  3. char pop(stack **top) function delete the value in the given and returns the delete value.
  4. char peep(stack *top) function returns the value which exists at the top of the stack.
  5. void dispalystack(stack *top) function displays the contents of the stack.

Program description:

The main purpose of the program is to create a stack from the input string as a character by character. Then it compares the original string with stack value by ignoring the space and punctuation marks and checks whether input string is palindrome or not.

Blurred answer
Students have asked these similar questions
Expression Conversion [Problem Description] Design a program which can tansfer an infix expression into a postfix expression and compute its result. Suppose the infix expression only includes’ *’, ‘/’, ‘+’, ‘-‘, ‘(‘, ‘)’ and the numbers are all integers. [Basic Requirements] You are required to use stack. The infix expression is inputted from keyboard as a string. If the input is legal, please convert the infix expression into postfix expression, calculate the result, and finally output the postfix expression and its value. If the infix expression entered is illegal, the program can prompt the user to input incorrectly and prompt the user to re-enter.                  please i need the program in c or c++ and please read the requirement below     Algorithm design: The required data structure is designed, the algorithm idea and algorithm steps are given, and the time complexity of the algorithm is analyzed. Annotated source code: Paste the source code, preferably annotate the code.…
a) Select whether the statement is True or False. i. A stack is a data structure in which the items can be added and deleted from both ends of the structure. (True / False) ii. The basic operations on a stack are as follows: Push an item onto the stack, pop an item from the stack, retrieve the top element of the stack, initialize the stack, check whether the stack is empty, and check whether the stack is full. (True / False) ii. The middle elements of a stack could be accessed directly. (True / False) iv. Postfix notation does not require the use of parentheses to enforce operator precedence, and the operators are written after the operands. T(True / False) b) Convert the following infix expressions to postfix notations. i. (A + B) * (C + D) - E ii. A (B + C) * D + E / F iii. ( (A + B) / (C - D) + E) * F - G iv. A + B * (C + D) E / F * G + H
Expression Conversion[Problem Description]Design a program which can tansfer an infix expression into a postfix expression and compute its result. Suppose the infix expression only includes’ *’, ‘/’, ‘+’, ‘-‘, ‘(‘, ‘)’ and the numbers are all integers.[Basic Requirements]1)      You are required to use stack.2)      The infix expression is inputted from keyboard as a string. If the input is legal, please convert the infix expression into postfix expression, calculate the result, and finally output the postfix expression and its value.If the infix expression entered is illegal, the program can prompt the user to input incorrectly and prompt the user to re-enter.    Please i need the above topic program in C or C++
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education