Sunidhi Bansal has Published 1101 Articles

Merge Sort Tree in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 07:20:07

440 Views

We are given an integer array, a set of segment start and end pointers and a key value and the problem statement here is to find all the values in the given range which are smaller than or equal to the given key value.Let us understand with exampleInput − arr[] = ... Read More

Merge Sort using Multithreading in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 07:04:34

3K+ Views

We are given an unsorted integer array. The task is to sort the array using merge sort technique implemented via Multi-threadingMerge SortMerge sort is a sorting technique which is based on divide and conquer technique where we divide the array into equal halves and then combine them in a sorted ... Read More

Memorization (1D, 2D and 3D) Dynamic Programming in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 06:53:56

1K+ Views

Memorization is a technique based on dynamic programming which is used to improve the performance of a recursive algorithm by ensuring that the method does not run for the same set of inputs more than once by keeping a record of the results for the provided inputs(stored in an array).Memorization ... Read More

Maximum subarray sum after dividing array into subarrays based on the given queries in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 06:04:04

187 Views

We are given two integer arrays, one having the elements which are computed and other having split points which are required to split the array for making subset and we have to calculate the sum of each subset in every split and return the maximum subset sum.Let us understand with ... Read More

Find array using different XORs of elements in groups of size 4 in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 06:03:24

116 Views

We are given with an integer array of size N(size of multiple 4) and we have to perform Xclusive OR operation on the array such that input[1- 4] resembles utility_arr[1- 4] and the conditions of computing is If arr[1 – 4] = {a1, a2, a3, a4} then q[1 – 4] ... Read More

Meet in the middle in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 05:34:40

240 Views

We are provided with an array and a sum value; the problem statement is to calculate the maximum subset sum which does not exceed the given sum value. We cannot apply the brute force approach here because the structure of the given array is not the same as the divide ... Read More

Maximize the total profit of all the persons X in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 05:27:21

241 Views

We are given 5 Integer variables Num, P1, P2, profit_P1, profit_P2 and the task is to maximize the profit and from all the natural numbers in the range of [1, Num]. The approach here is that if a positive number is divisible by P1 the profit increases by profit_P1 and ... Read More

Merge K sorted linked lists in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 05:20:42

590 Views

We are given a K number of linked lists of variable sizes which are sorted in their sequence and we have to merge the list into a resultant list in such a way that the resultant array is sorted in order and the resultant array is printed as the output ... Read More

Minimum number of bombs in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 05:12:36

159 Views

The problem statement here is to kill the goons in the rooms of a building with minimum number of bombings. The rooms are labelled as 1 to n. The goons are injured by the first bombing attack and die in the second. When the rooms are bombed the goons rush ... Read More

Merge k sorted arrays in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 05-Nov-2021 05:07:13

530 Views

We are given an ‘n’ number of arrays, let's say we take three arrays i.e. arr1[], arr2[] and arr3[] of integer type. The task is to merge all the given integer arrays in such a manner that the resultant array is sorted in the runtime only.Let us understand with exampleInput −Inta[]={21, ... Read More

Advertisements