Hafeezul Kareem has Published 328 Articles

Find a partition point in array in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:59:38

422 Views

In this tutorial, we are going to find the partition point in an array where all the elements left to the partition point are small and all the elements right to the partition point are large.Let's see the steps to solve the problem.Initialize the array.Iterate over the array.Iterate from 0 ... Read More

Find a pair with given sum in BST in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:58:31

209 Views

In this tutorial, we are going to write a program that finds the pair whose sum is equal to the given number in the binary search tree.We are going to store and values of trees in two different lists to find the pairs. Let's see the steps to solve the ... Read More

Find a Number X whose sum with its digits is equal to N in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:58:04

204 Views

In this tutorial, we are going to find a number whose some including with its digits is equal to the given number N.The idea is simple, we are going to check the left and right 100 numbers of the given number. It won't lie out that bound as N ≤ ... Read More

Find a number that divides maximum array elements in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:57:48

199 Views

In this tutorial, we are going to find the number that is divided into maximum elements in the given array.Let's see the steps to solve the problem.Initialize the array and a variable to store the result.Iterate over the array.Initialize the counter variable.Iterate over the array again.Increment the counter if the ... Read More

Find (1^n + 2^n + 3^n + 4^n) mod 5 in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:47:43

249 Views

In this tutorial, we are going to solve the following problem.Given an integer n, we have to find the (1n+2n+3n+4n)%5The number (1n+2n+3n+4n) will be very large if n is large. It can't be fit in the long integers as well. So, we need to find an alternate solution.If you solve ... Read More

Find 2^(2^A) % B in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:45:39

124 Views

In this tutorial, we are going to write a program to evaluate the equation 2^(2^A) % B.We are going to find the value of the equation using a recursive function. Let's see the steps to solve the problem.Write a recursive function that takes 2 arguments A and B.If A is ... Read More

Find A and B from list of divisors in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:42:59

161 Views

In this tutorial, we are going to solve the below problem.Given an array of integers, we have to find two numbers A and B. All the remaining numbers in the array are the divisors of A and B.If a number is a divisor of both A and B, then it ... Read More

Find (a^b)%m where ‘a’ is very large in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:42:43

228 Views

In this tutorial, we are going to solve the equation (ab)%m where a is a very large number.The equation (ab)%m=(a%m)*(a%m)...b_times. We can solve the problem by finding the value of a%m and then multiplying it b times.Let's see the steps to solve the problem.Initialize the numbers a, b, and m.Write ... Read More

Final string after performing given operations in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 11:42:25

207 Views

In this tutorial, we are going to solve the following problem.Given a string containing only characters a and b, our task is to delete the sub-string ab from the string. And print the remaining string.Here, the idea is very simple to solve the problem. Every string with only a's and ... Read More

Create new linked list from two given linked list with greater element at each node in C++ Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 28-Jan-2021 07:05:45

2K+ Views

In this tutorial, we are going to write a program that creates a new linked list from the given linked lists.We have given two linked lists of the same size and we have to create a new linked list from the two linked lists with the max numbers from the ... Read More

Advertisements