Count pairs from two linked lists whose sum is equal to a given value

Problem Statement Problem “Count pairs from two linked lists whose sum is equal to a given value” state that you are given two linked lists and an integer value sum. The problem statement asked to find out how many total pair has a sum equal to the given value. Example …

Read more

Binary Search Tree Search and Insertion

Problem Statement Write an algorithm to perform searching and insertion in Binary Search Tree. So what we are going to do is insert some of the elements from input into a binary search tree. Whenever asked to search a particular element, we’ll be searching it among the elements in BST(short …

Read more

Number of palindromic paths in a matrix

Problem Statement We are given a two-dimensional matrix containing lowercase English alphabets, we need to count the number of palindromic paths in it. A palindromic path is nothing but a path following palindromic property. A word which when reversed remains the same as the initial word is said to be …

Read more

Cumulative Frequency of Count of Each Element in an Unsorted Array

We are given an unsorted array. The task is to calculate the cumulative frequency of count of each element in an unsorted array. Example Input: A[]={2,4,3,2,2,3,4} Output: Cumulative frequency of 2 in the array is: 3 Cumulative frequency of 3 in the array is: 5 Cumulative frequency of 4 in …

Read more

Translate »