Sunidhi Bansal has Published 1100 Articles

Maximum number of threads that can be created within a process in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 04-Aug-2020 12:29:20

839 Views

Given the task is to find the maximum number of threads that can be created within a process in C.A thread is lightweight process and can be independently managed by the scheduler. Because a thread is a component of a process, therefore multiple number of threads can be associated in ... Read More

Maximum number of squares that can fit in a right angle isosceles triangle in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:47:45

265 Views

Given the task is to find the maximum number of squares having side ‘a’ that can fit inside a give right angle isosceles triangle with base of ‘s’(An isosceles triangle has at least 2 equal sides).Let’s now understand what we have to do using an example:Inputs=5, a=1Output10Explanation − The number ... Read More

Maximum number of segments that can contain the given points in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:46:29

174 Views

Given the task is to find the maximum of segments that can contain the given points.Given an array a1[] with size n1 and two integers A and B are given. From the given array a1[], n1 line segments can be formed with starting and ending points as a1[i] – A ... Read More

Maximum number of removals of given subsequence from a string in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:43:55

110 Views

Given the task is to find the maximum number of removals of given subsequence from a string. A string s is given and we have to find the maximum number of subsequence ‘abc’ that can be removed from the string.Let’s now understand what we have to do using an example:Inputs ... Read More

Maximum number of people that can be killed with strength P in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:41:53

138 Views

Given the task is to find the maximum number of people that can be killed with strength P. Consider a row with infinite people and each of them have an index number starting from 1.The strength of the sth person is represented by s2. After killing a person with s ... Read More

Maximum length subsequence with difference between adjacent elements as either 0 or 1 | Set 2 in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:40:47

103 Views

We are given an array of any size and the task is to find the subsequence in the given array with the elements having difference between adjacent elements as 0 or 1.Input − int arr[] = { 2, 1, 5, 6, 3, 4, 7, 6}Output − Maximum length subsequence with ... Read More

Maximum length subsequence with difference between adjacent elements as either 0 or 1 in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:38:53

745 Views

We are given an array of any size and the task is to find the subsequence in the given array with the elements having difference between adjacent elements as 0 or 1.Input − int arr[] = { 2, 1, 5, 6, 3, 4, 7, 6}Output − Maximum length subsequence with ... Read More

Maximum length subarray with difference between adjacent elements as either 0 or 1 in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:38:08

563 Views

We are given an array of any size and the task is to find the subarray of the given array with the elements having difference between adjacent elements as 0 or 1.Input − int arr[] = { 2, 1, 5, 6, 3, 4, 7, 6}Output − Maximum length subarray with ... Read More

Maximum number of contiguous array elements with same number of set bits in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:35:36

96 Views

We are given with an unsorted array of integer elements and the task is to calculate the two major things i.e.Elements with same number of set bitsAlso, Elements with the same set bits should be contiguous in nature.Inputint arr[] = { 5, 8, 1, 2, 9, 12}Output − Maximum number ... Read More

Maximize big when both big and small can be exchanged in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:32:31

131 Views

We are given a big object let’s say, ‘a’ and a small object let’s say, ‘b’. The choices for the object ‘a’ and ‘b’ depend upon the user. In the example below, we are taking objects to be toys which are big as well as small as per the size ... Read More

Advertisements