Arnab Chakraborty has Published 4293 Articles

Find four factors of N with maximum product and sum equal to N - Set-2 in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 11:01:57

118 Views

ConceptWith respect of a given integer N, our task is to determine all factors of N and print the product of four factors of N so that −The sum of the four factors is equal to N.The product of the four factors is largest.It has been seen that if it ... Read More

Find First element in AP which is multiple of given Prime in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:58:32

76 Views

ConceptWith respect of given first term (A) and common difference (d) of an Arithmetic Progression, and a prime number (P), our task is to determine the position of the first element in the given AP which is treated as a multiple of the given prime number P.InputA = 3, d ... Read More

Find element position in given monotonic Sequence in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:57:31

270 Views

ConceptWith respect of a given integer l and a monotonic increasing sequence −f(m) = am + bm [log2(m)] + cm^3 where (a = 1, 2, 3, …), (b = 1, 2, 3, …), (c = 0, 1, 2, 3, …) Remember, here, [log2(m)] indicates, taking the log to the base ... Read More

Find Duplicates of array using bit array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:48:52

378 Views

ConceptWe have an array of n numbers, where n is maximum 32, 000. Now the given array may have duplicate entries and we do not know what n is. Now the question is arisen that with only4 Kilobytes of memory available, how would display or print all duplicates elements in ... Read More

Find distinct elements common to all rows of a Matrix in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:48:04

287 Views

ConceptWith respect of a given an m x m matrix, the problem is to determine all the distinct elements common to all rows of the matrix. So the elements can be displayed in any order.Inputmat[][] = { {13, 2, 15, 4, 17}, {15, 3, 2, 4, 36}, {15, 2, 15, ... Read More

Find d to maximize the number of zeros in array c[] created as c[i] = d*a[i] + b[i] in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:43:49

185 Views

ConceptWith respect of two given arrays of M integers, assume an array C, where the i-th integer will be d*a[i] + b[i] where d is indicated as any arbitrary real number. Our task is to display or print d such that array C has largest number of zeros and also ... Read More

Find combined mean and variance of two series in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jul-2020 10:40:50

149 Views

ConceptWith respect of two given two different series arr1[b] and arr2[a] of size b and a. Our task is to determine the mean and variance of combined series.InputArr1[] = { 24, 46, 35, 79, 13, 77, 35 }; Arr2[] = { 66, 68, 35, 24, 46 };OutputMean1: 44.1429 Mean2: 47.8 ... Read More

Find an integer X which is divisor of all except exactly one element in an array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jul-2020 09:13:11

197 Views

ConceptWith respect of a given array of integers, our task is to determine an integer B which isthe divisor of all except for exactly one element in the given array.It should be noted that the GCD of all the elements is not 1.Input arr[] = {8, 16, 4, 24}Output 8 8 is ... Read More

Find a permutation that causes worst case of Merge Sort in C

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jul-2020 08:33:31

314 Views

ConceptWith respect of a given set of elements, determine which permutation of these elements would result in worst case of Merge Sort?We know, asymptotically, merge sort always consumes O(n log n) time, but the cases that need more comparisons generally consume more time in practice. Now we basically require determining ... Read More

Find a pair with given sum in a Balanced BST in Java

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jul-2020 08:32:23

232 Views

ConceptWith respect of a given Balanced Binary Search Tree and a target sum, we write a function that returns true if there is a pair with sum equals to target sum, otherwise return false. In this case, expected time complexity is O(n) and only O(Logn) extra space can beimplemented. Here, ... Read More

Advertisements