Found 73 Articles for Campus Interview

Java Program to Rotate Matrix Elements

AmitDiwan
Updated on 29-Mar-2022 09:04:31

527 Views

In this article, we will understand how to rotate matrix elements. A matrix is representation of the elements in rows and columns. Matrix rotation is shifting the position of each element of the matrix by 1 position towards it’s right or left.Below is a demonstration of the same −Suppose our input is −The matrix is defined as 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16The desired output would be −The matrix after one rotation: 5 1 2 3 9 10 6 4 13 11 7 8 14 15 16 12AlgorithmStep 1 - ... Read More

Java Program to Print Boundary Elements of a Matrix

AmitDiwan
Updated on 30-Mar-2022 08:01:35

2K+ Views

In this article, we will understand how to print boundary elements of a matrix. A matrix is representation of the elements in rows and columns. Boundary elements are those elements which are not surrounded by elements on all four directions. For example, the elements in the first row, first column, last row and last column.Below is a demonstration of the same −Suppose our input is −The input matrix: 9 8 9 8 8 7 8 7 7 6 7 6 6 5 6 5The desired output would be −The border elements of the matrix is: 9 8 9 8 8 ... Read More

Java Program to Calculate Standard Deviation

AmitDiwan
Updated on 09-Jul-2024 17:52:30

2K+ Views

In this article, we will understand how to calculate standard deviation. The standard deviation is the measure of how spread-out numbers are. The symbol of standard deviation is sigma( σ ). It is the square root of variance. Standard deviation is computed using the formula square root of ∑(Xi - ų)2 / N where Xi is the element of the array, ų is mean of the elements of the array, N is the number of elements, ∑ is the sum of the each element. Problem Statement Given a program in Java to calculate the standard deviation of a given ... Read More

Previous 1 ... 4 5 6 7 8
Advertisements