Tag Archives: stack

Evaluation of postfix expression algorithm using stacks

Algorithm for Evaluation of postfix expression

Postfix expression also known as   Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its operands, in contrast to Polish notation (PN), which puts the operator before its operands. It is also known as postfix notation. It does not need any parentheses as long as each operator has a fixed number of operands.

Evaluation of postfix expression
Title – Evaluation of postfix expression

Continue reading Evaluation of postfix expression algorithm using stacks

Example Infix to postfix Conversion Using stacks

Example Infix to postfix conversion

Infix To postfix conversion example
Infix To postfix conversion example

 

In order to understand the example described below you need to be aware of the algorithm associated with this conversion which is described in the link below. Along with the algorithm, the meaning of each term along with c code is given below:- Continue reading Example Infix to postfix Conversion Using stacks

Infix to Postfix conversion using stack algorithm

Infix to postfix conversion algorithm

To understand the concept of infix to postfix conversion concept you need to know the know the meaning of the infix, prefix and postfix. Please go through this article to understand the concept better.

Infix to postfix conversion algorithm
Infix to postfix conversion algorithm
READ  Infix Prefix postfix expressions - datastructures

Before we dive in we need to be aware of a few basic concept used in this algorithm. Continue reading Infix to Postfix conversion using stack algorithm

Implementation of stack using array

Stack using array

Please go through this article for good understanding of stacks concept.

READ  Basic Concept of a stack - Push and pop
stack implementation
Implementation – Stack using array

Continue reading Implementation of stack using array

Basic Concept of a stack – Push and pop

Stack

A stack is a data structure which is used for storing data . It can be imagined as a pile of books one above the other. Order of the data is the one which comes last goes out first.

It is called a last-in-first-out (LIFO) collection. This means that the last thing we added (pushed) is the first thing that gets pulled (popped) off. If the last card we put on our stacks of cards was an ace, then the first card we pulled from the top is that same ace.

stack - tilte
Stacks Data structure

Continue reading Basic Concept of a stack – Push and pop

Implement stack using linked list program in c

Implement stack using linked list

Suppose you have a linked list, you have to use that linked list as a stack i.e stack using linked list.

A stack is called a last-in-first-out (LIFO) collection. This means that the last thing we added (pushed) is the first thing that gets pulled (popped) off. If the last card we put on our stack of cards was an ace, then the first card we pulled from the top is that same ace.

Stack

Continue reading Implement stack using linked list program in c