Skip to Main Content
Data Structures Using C, 2nd Edition by Pearson
book

Data Structures Using C, 2nd Edition by Pearson

by A. K. Sharma
May 2024
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 12m
English
Pearson India
Content preview from Data Structures Using C, 2nd Edition by Pearson
166 Data Structures Using C
}
3. repeat steps 1 and 2
4. stop
}
Example 6: Write a program that uses a stack to evaluate a postfix expression.
Solution: The algorithm evalPostfix()and the following data structures would be used for the
required program. The postfix expression will be stored in an array called postfix[] of following
structure type.
struct term /* structure to store an element */
{
char element;
float val;
};
where
element stores an operand or an operator.
val’ stores the actual value of the operand or 0 for an operator.
For instance, the expression ABC
*
1; for values A 5 10, B 5 15, C 5 8 will be stor ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey
Intermediate C Programming, 2nd Edition

Intermediate C Programming, 2nd Edition

Yung-Hsiang Lu, George K. Thiruvathukal

Publisher Resources

ISBN: 9781299831582