**Objective:** Given a binary tree, find the height of it

**Input:** A Binary Tree

**Output: **Height of a binary tree

**Example: **

**Approach:**** Recursion:**

Objective: Given a graph represented by the adjacency List, write a Depth-First Search(DFS) algorithm to check whether the graph is … Read more

Earlier we had discussed how to evaluate prefix expression where operands are of single-digit. In this article, we will discuss … Read more

Prefix notation is a notation for writing arithmetic expressions in which the operands appear after their operators. There are no … Read more

Objective: Given a Prefix expression, write an algorithm to convert it into Postfix expression. Example: Input: Prefix expression: + A … Read more

Objective: Given a Postfix expression, write an algorithm to convert it into prefix expression. Example: Input: Postfix expression: A B … Read more

Objective: Given a Postfix expression, write an algorithm to convert it into Infix expression. Example: Input: Postfix expression: A B … Read more

Objective: Given a Prefix expression, write an algorithm to convert it into Infix expression. Example: Input: Prefix expression: + A … Read more

Objective: Given an Infix expression, write an algorithm to convert it into Prefix expression. Example: Input: Infix expression – A … Read more

Objective: Given a directed graph that represents a flow network involving source(S) vertex and Sink (T) vertex. Each edge in … Read more

Objective: Given an Infix expression, write an algorithm to convert it into Postfix expression. Example: Input: Infix expression – A … Read more

Infix notation is commonly used in arithmetic formula or statements, the operators are written in-between their operands. Let’s assume the … Read more

Objective: Given an array, write an algorithm to reverse the array. Example: int a[] = {1, 2, 3, 4, 5} … Read more

Objective: The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers that has the largest … Read more

Objective: – Find the Height of a tree without Recursion. In our earlier post “Height of tree” we used recursion … Read more

**Objective:** Given a binary tree, find the height of it

**Input:** A Binary Tree

**Output: **Height of a binary tree

**Example: **

**Approach:**** Recursion:**