
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

180 Views
In this problem, we are given an array arr[] of n positive integers. Our task is to create a program to find the Maximum product of an increasing subsequence of size 3.Problem Description − Here, we need to find the maximum product of 3 elements of the array such that they form an increasing subsequence and array index are also increasing i.e.arr[i]*arr[j]*arr[k] is maximum, arr[i] j to n−1Step 1.1.1.1 −if(arr[j] < arr[k]) −> find prod = arr[i]*arr[j]*arr[k].Step 1.1.1.2 −if(maxProd > prod) −> maxProd = prod.Step 2 −Return maxProd.ExampleProgram to illustrate the working of our solution, Live Demo#include using namespace ... Read More

706 Views
In this problem, we are given an array arr[] consisting of n integers. Our task is to find the maximum product of a triplet (subsequence of size 3) in array. Here, we will be finding the triple with maximum product value and then return the product.Let’s take an example to understand the problem, Inputarr[] = {9, 5, 2, 11, 7, 4}Output693ExplanationHere, we will find the triplet that gives the maximum product of all elements of the array. maxProd = 9 * 11 * 7 = 693Solution ApproachThere can be multiple solutions to the problem. We will be discussing them here, ... Read More

934 Views
A three-dimensional array can have matrices of different size and they are not necessarily to be square or rectangular. Also, all the elements in an array are of same data type. To create a three-dimensional array of different size we would need to use the proper number of rows and columns within the array function.Example Live DemoA1

965 Views
The word percentile means the percentage that falls below or above the percentile value. For example, if we have a value that lies at 50th percentile then we would say 50 percent of the values lies below or above that value. The value 50 here is called the percentile rank. To find the percentile rank for groups in an R data frame, we can use mutate function of dplyr package.ExampleConsider the below data frame − Live DemoGroup

413 Views
To combine three vectors into a list with corresponding elements representing a single element of the list we can use mapply function. For example, if we have three vectors x, y, and z each having number of elements equal to one-hundred then the list with corresponding elements can be created by using mapply(c,x,y,z,SIMPLIFY=FALSE).Example Live Demox1

900 Views
First thing you must remember while moving on to post hoc analysis is the null hypothesis of the analysis of variance must be rejected, so that we can claim there exists a difference in the group means. Now, once we achieve that the tukey HSD can be performed simply by using TukeyHSD function in base R.ExampleConsider the below data frame − Live Demox1

133 Views
The shortest way to round to the integer value is using trunc function. The trunc function is used to return the largest integer that is smaller than or equal to the actual value, that means it rounds downs to the nearest integer. It works as a ceiling function for negative number and floor function for positive number.Example Live Demox1

220 Views
The quadratic regression model can be plotted by using the plot function but we would need to find the fitted values using the model and this can be done with the help of fitted function. For example, if we have a quadratic model M and the data has an independent variable x then the model against x can be created by using plot(x,fitted(M)).Example Live Demox1

1K+ Views
If we have a vector that contains dates as sequence that needs to be plotted on the X-axis and another vector for the response then the plot can be simply created by using the plot function. In the plot function, we would need to pass the dates as the first argument and the response vector as the second argument. Check ou the examples below to understand how it works.Example Live Demox

894 Views
To create a regression line in base R, we use abline function after creating the scatterplot but if we want to have the line dash format then lty argument must also be used with value equals to 2 after defining the regression model inside abline. For example, if we have two columns x and y stored in a data frame called df then the plot with dashed regression line can be created by using −plot(y~x, data=df) abline(lm(df$y~df$x), lty=2)ExampleConsider the below data frame − Live Demo> x y df dfOutput x y 1 5.243553 4.969598 2 4.681088 ... Read More