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
Don't use inbuilt stack and provide codes for .cpp and .h Please provide a clear codes and output. Need ASAP. Thank you!
What is the value of the following postfix expressions? Show the stack contents as each operand and operator is processed. Make it clear where the top of the stack is at each step?               5 1 / 3 * 3 1 – *
Q1- Write a program to insert five elements in the stack and print the top element using top() and print the size of the stack and check if the stack is empty or not.
Knowledge Booster
Background pattern image
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