Replace two consecutive equal values with one greater

Problem Statement Suppose you have an integer array. The problem “Replace two consecutive equal values with one greater” asks to replace all those pair values say ‘a’ which comes consecutively with a number “a+1” 1 greater than them (two consecutive numbers), such that even after the modification or repetition there …

Read more

Maximum Depth Of Binary Tree

Problem Statement “Maximum depth of binary tree” problem states that you are given a binary tree data structure. Print the maximum depth of the given binary tree. Example Input 2 Explanation: Maximum depth for the given tree is 2. Because there is only a single element below the root (i.e. …

Read more

Check if all Rows of a Matrix are Circular Rotations of Each Other

Problem Statement In the “Check if all Rows of a Matrix are Circular Rotations of Each Other” problem we have given a char matrix, write a program to find whether all rows are circular rotations of each other or not. If all rows are circular rotations of each other print …

Read more

Translate »