Articles on Trending Technologies

Technical articles with clear explanations and examples

Fixed (or static) Partitioning in Operating System in C++

Hafeezul Kareem
Hafeezul Kareem
Updated on 11-Mar-2026 1K+ Views

In this tutorial, we are going to learn about the fixed partitioning in the operating system.Fixed partitioning is one to manage the memory in operating system. It's an old technique. It divides the memory into equal blocks. The size of each block is predefined and can not be changed.The memory is used for the contiguous processes.ExampleLet's see the sample program that allocates memory based on the process size.#include using namespace std; int main() {    int blockNumber = 5, processesNumber = 3;    int blockSize[5] = {4, 4, 4, 4, 4}, processSize[3] = {1, 2, 3};    int flags[5], allocation[5]; ...

Read More

How to convert NA's in sequence to a single NA in an R vector?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 216 Views

Sometimes values are missing in a sequence and R program records them as NA (Not Available). In this type of situation, we might want to replace consecutive NA records with single NA value. This can be done by using is.na along with diff function as shown in the below examples.Examplex1

Read More

How to find the range for 95% of all values in an R vector?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 2K+ Views

The range for 95% of all values actually represents the middle 95% values. Therefore, we can find the 2.5th percentile and 97.5th percentile so that the range for middle 95% can be obtained. For this purpose, we can use quantile function in R. To find the 2.5th percentile, we would need to use the probability = 0.025 and for the 97.5th percentile we can use probability = 0.0975.Examplex1

Read More

Program to find sum of k non-overlapping sublists whose sum is maximum in C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 366 Views

Suppose we have a list of numbers called nums, and another value k, we have to find the k non-overlapping, non-empty sublists such that the sum of their sums is maximum. We can consider k is less than or equal to the size of nums.So, if the input is like nums = [11, -1, 2, 1, 6, -24, 11, -9, 6] k = 3, then the output will be 36, as we can select the sublists [11, -1, 2, 1, 6], [11], and [6] to get sums of [19, 11, 6] = 36.To solve this, we will follow these steps ...

Read More

How to add a variable to the model in base R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ Views

If we want to add variables to the model in base R then update function can be used. The update function will update the previous modle by adding the new variable and this variable can be a single variable as well as an interaction of the two or more also any possible transformation of the existing variables.ExampleConsider the below data frame −x1

Read More

How to find the mean of a numerical column by two categorical columns in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ Views

If we have two categorical columns along with a numerical column in an R data frame then we can find the mean of the numerical column by using the combination of the categorical columns with the help of aggregate function. For example, if a data frame df contains a numerical column X and two categorical columns C1 and C2 then the mean of X can be found for the combinations of C1 and C2 by using the below command −aggregate(X~C1+C2,data=df,FUN="mean")ExampleConsider the below data frame −C1

Read More

How to find the column number of a string column based on a string match in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 583 Views

A data frame might be very long and contain columns with only string values as well as numerical values. While doing the analysis, we might want to check which columns contain a particular string value. For example, if we have a column with string values as A, B, and C and we want to check which column contains a value “A” then apply function can be used as shown in the below examples.ExampleConsider the below data frame −x1

Read More

How to create the boxplots in base R ordered by means?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 225 Views

To create the boxplots in base R ordered by means, we first need to order the categorical column based on the mean of the numerical column and then the boxplot will be created.For example, if we have a data frame df that has a categorical column x and a numerical column y then the boxplot ordered by means can be created by using df$x

Read More

How to create a plot with tick marks between X-axis labels in base R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 4K+ Views

To create a plot with tick marks manually between X-axis values in base R, we first need to create the plot without X-axis labels then add the axis values using axis function with appropriate labels, this will create tick marks as well as labels. After this step, we would need to use the axis function again to add the tick marks without labels.Exampleplot(1:10,xaxt='n',type="l") axis(1,at=1:10) axis(1,at=seq(0,11,0.2),labels=NA)OutputExampleplot(1,xaxt='n') axis(1,at=1) axis(1,at=seq(0,2,0.05),labels=NA)Output

Read More

Program to find maximum sum of two sets where sums are equal in C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 323 Views

Suppose we have a list of numbers called nums, now find two sets as their sums are same and maximum, then find sum value.So, if the input is like nums = [2, 5, 4, 6], then the output will be 6, as the sets are [2, 4] and [6].To solve this, we will follow these steps −sum := 0for each number i in nums, dosum := sum + in := size of numsDefine one 2D array dp of size (n + 1) x (2 * sum + 5) and fill with -1dp[0, sum] := 0for initialize i := 1, when ...

Read More
Showing 25751–25760 of 61,299 articles
Advertisements