Sudhir sharma has Published 1149 Articles

Dual Mode operations in OS in C++

sudhir sharma

sudhir sharma

Updated on 22-Jan-2021 12:29:14

3K+ Views

Every system works on operations mainly in two modes to safeguard hardware’s computation. The two modes are −User ModeKernel ModeUser Mode −The OS mode in which all the user applications and programs will run. Here, the user instructions are worked on and softwares like playing music is run.Kernel Mode −The OS ... Read More

Query for ancestor-descendant relationship in a tree in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:48:39

267 Views

In this problem, we are given an N vertex tree and Q queries each consisting of two values i and j. Our task is to create a program to solve a Query for ancestor-descendant relationship in a tree.To solve each query, we need to check whether the node i is ... Read More

Queries to update a given index and find gcd in range in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:46:39

255 Views

In this problem, we are given an array arr[] of size N and Q queries which can be of two types. Our task is to create a program to solve the queries to update a given index and find GCD in the range.Queries are −Type 1 − {1, index, value} ... Read More

Queries to return the absolute difference between L-th smallest number and the R-th smallest number in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:44:35

128 Views

In this problem, we are given an array arr[] of size n and Q queries each consisting of 2 values L and R. Our task is to create a program to solve queries to return the absolute difference between L-th smallest number and the R-th smallest number.Problem Description − To ... Read More

Queries to check if substring[L…R] is palindrome or not in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:41:07

510 Views

In this problem, we are given string str, Q number of queries each consisting of two values L and R for substring[L...R]. Our task is to create a program to solve Queries to check if substring[L…R] is palindrome or not.Problem Description − For solving each query, we need to check ... Read More

Queries to check if it is possible to join boxes in a circles in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:37:44

115 Views

In this problem, we are given a number n that denotes n boxes that lie on the edge of a circle. And there are Q queries each consisting of two integers, a and b. Our task is to create a program to solve queries to check if it is possible ... Read More

Queries to check if a number lies in N ranges of L-R in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:35:43

192 Views

In this problem, we are given a 2-D matrix arr[][2] that consists of n ranges (L, R), L-R. And Q queries each consisting of an integer value. Our task is to create a program to solve the Queries to check if a number lies in N ranges of L-R.Problem Description ... Read More

Queries for number of distinct integers in Suffix in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:33:55

263 Views

In this problem, we are given an array arr[] of n integer values. And Q queries each having an integer k. Our task is to create a program to solve the Queries for number of distinct integers in Suffix.Problem Description − We need to solve queries for distinct integers in ... Read More

Maximums from array when the maximum decrements after every access in C++ Program

sudhir sharma

sudhir sharma

Updated on 22-Dec-2020 08:31:46

168 Views

In this problem, we are given an array arr[] of N integers and an integer m. Our task is to create a program to find the maximums from array when the maximum decrements after every access.Problem Description − We need to find the maximum sum of maximum elements of the ... Read More

Maximum Weight Difference in C++ Program

sudhir sharma

sudhir sharma

Updated on 09-Dec-2020 13:47:35

257 Views

In this problem, we are given an array arr[] and a number M. Our task is to create a program to calculate the Maximum Weight Difference in C++.Problem descriptionWe will find M elements from the array such that the absolute difference between the sum and the sum of the rest ... Read More

Advertisements