Hafeezul Kareem has Published 344 Articles

k-Rough Number or k-Jagged Number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:26:56

115 Views

In this tutorial, we are going to write a program that checks whether the given number is k-rough or k-jagged number or not.The number whose smallest prime factor is greater than or equal to the given k, it is called k-rough or k-jagged number.Let's see the steps to solve the ... Read More

Find any one of the multiple repeating elements in read only array in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:22:06

73 Views

In this tutorial, we are going to write a program that finds the repeating element in the given array.Let's see the steps to solve the problem.Initialize the array.Initialize a counter map to store the frequency of each element in the array.Iterate over the array.Count each element.Print the element whose frequency ... Read More

Find amount of water wasted after filling the tank in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:18:23

232 Views

In this tutorial, we are going to solve the following problem.Given a tank with a capacity of N liters and a pump that fill the tank with S speed per minute. Unfortunately, there is a hole in the tank. And water is wasting at a speed of WS per minute ... Read More

Find all the pairs with given sum in a BST in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:18:07

291 Views

In this tutorial, we are going to write a program that finds all the pairs 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 ... Read More

Find all divisors of a natural number - Set 2 in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:13:53

715 Views

In this tutorial, we are going to write a program that finds all the divisors of a natural number. It's a straightforward problem. Let's see the steps to solve it.Initialize the number.Write a loop that iterates from 1 to the square root of the given number.Check whether the given number ... Read More

Find all divisors of a natural number - Set 1 in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:10:48

5K+ Views

In this tutorial, we are going to write a program that finds all the divisors of a natural number. It's a straightforward problem. Let's see the steps to solve it.Initialize the number.Write a loop that iterates from 1 to the given number.Check whether the given number is divisible by the ... Read More

Find all triplets with zero sum in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:09:53

298 Views

In this tutorial, we are going to write a program that finds the triplet in the array whose sum is equal to the given number.Let's see the steps to solve the problem.Create the array with dummy data.Write three inner loops for three elements that iterate until the end of the ... Read More

Find a value whose XOR with given number is maximum in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:09:05

163 Views

In this tutorial, we are going to write a program that finds the number whose XOR operation with the given number is maximum.We are assuming the number of bits here is 8.The XOR operation of different bits gives you the 1 bit. And the XOR operation between the same bits ... Read More

Find a triplet that sum to a given value in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:06:24

546 Views

In this tutorial, we are going to write a program that finds the triplet in the array whose sum is equal to the given number.Let's see the steps to solve the problem.Create the array with dummy data.Write three inner loops for three elements which iterate until the end of the ... Read More

Find a triplet from three linked lists with a sum equal to a given number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:05:45

136 Views

In this tutorial, we are going to write a program that finds the triplet in the linked list whose sum is equal to the given number.Let's see the steps to solve the problem.Create a struct node for the linked list.Create the linked list with dummy data.Write three inner loops for ... Read More

Advertisements