Queue Data Structure and Its Operations

What is Queue ? The process of inserting an element in the queue is called enqueue, and the process of deleting an element from the queue is called dequeue. For example: At Bus Stop, People is in queue and waiting for a bus. The person who is standing in the line at the first position … Read more

Types of Recursion with Example

Recursion is a process in which a function calls itself again and again. We use recursion to solve bigger problem by dividing it into smaller similar sub-problems and then call them recursively. Types of Recursion Recursive functions can be classified on the basis of a) Based on functions call itself – Direct / Indirectb) Based … Read more

Recursion, its principle with an example

Recursion is a process in which a function calls itself again and again. We use recursion to solve the bigger problem by dividing it into smaller similar sub-problems and then call them recursively. In other words, we can also explain it as a problem is broken down into smaller subproblems. And a function applies the … Read more

Algorithm to evaluate a prefix expression

Prefix notation is a notation in which operators are written before their operands. For example, the expressions given are in prefix notation / * A + B C D. Point to consider Permitted operands: A,B,C,D means any real number is permitted. Permitted operators: +,-, *, /, ^(exponentiation) Blanks are permitted in the expression Parenthesis are … Read more

Algorithm to evaluate a postfix expression

In Postfix expression operators are written after their operands. For example, the expressions given are in postfix notation A B C + * D /. Point to consider Prefix and Postfix expressions can be evaluated faster in comparison to an infix expression because we don’t need to process any brackets or follow the operator precedence … Read more

Algorithm to evaluate an infix expression

Generally arithmetic expressions are written in infix expression where the operator is written between the operands. Point to consider Suppose given infix expression is A+B*C-D where A,B,C,D are operands and +,*,- are operators. To solve the above infix expression we will use two stack Operand Stack : This stack will hold operands. Operator Stack : … Read more

Infix, Prefix and Postfix Expression with example

Infix, Postfix and Prefix notations are the ways of writing and evaluating Arithmetic & Algebraic expressions. Infix, prefix, and postfix are ways to write math expressions. Infix is what we use every day, like 2 + 3. Prefix, also called Polish notation, puts the operator before the numbers, like + 2 3. Postfix, or Reverse … Read more

Stack Implementation using Array Program

A stack is a fundamental data structure that follows the Last In, First Out (LIFO) principle, meaning the last element added to the stack will be the first one to be removed. It’s like a stack of plates, you add to the top and take from the top. This post will explore how to implement … Read more

Implement Stack using Singly linked list

Stack can be implemented by both array and linked list. There is some limitation or you can say that drawback in stack implementation using an array is that the array must be declared with some fixed size. In case if the size of the array becomes small to perform the required operation so this is … Read more

Hi, Welcome back!
Forgot Password?
Don't have an account?  Register Now