Found 9326 Articles for Object Oriented Programming

Find Minimum Elements in Each Row of Matrix in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 16:48:47

978 Views

In Java, Array is an object. It is a non-primitive data type which stores values of similar data type. The matrix in java is nothing but a multi-dimensional array which represents multiple rows and columns. As per the problem statement we have to find the minimum element present in every row of a given matrix of a multi-dimensional array. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose the original matrix is = { {2, 3, 11, 4, 6}, ... Read More

Convert Hexadecimal to Octal in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 16:39:26

704 Views

Octal Number − Octal number is also one of the number systems available. The octal number is represented with 8 digits which is from 0 to 7(0, 1, 2, 3... 7). The Octal numbers are expressed as base-8 in the numeral system. Hexadecimal Number − Hexadecimal number is also one of the number systems available. The Hexadecimal number is represented with 16 digits which is from 0 to 15(0, 1, 2, 3... 15). From 10 to 15 it is represented as A to F. The Hexadecimal numbers are expressed as base-16 in the numeral system. Here we first convert the ... Read More

How to Check Orientation of 3 Ordered Points in Java?

Mr. Satyabrata
Updated on 10-Mar-2023 16:36:28

251 Views

In this article we are going to find the orientation of 3 ordered points. Here orientation means that the given points form clockwise, anticlockwise or collinear shape in space. In the above diagram a, b, c are the three points which check the orientation of shape in space. We find the orientation of three given points by calculating the slope. To calculate slope and to calculate the orientation of 3 ordered points. Slope of line segmentSlope of line segment $(a, b):\theta=\left ( y_{b}-y_{a} \right )/\left ( x_{b} -x_{a}\right )$ Slope of line segment $(b, c):\phi=\left ( y_{c} -y_{b}\right )/(x_{c}-x_{b})$ And ... Read More

How to Check if the Matrix is a Magic Square in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 15:45:58

3K+ Views

Matrices are nothing but a collection of data elements arranged in a rectangular layout that is two-dimensional. In Java, an array with two dimensions can be considered as a matrix. As per the problem statement the task is to check if the matrix is a magic square or not. A matrix is said to be a magic square if the sum of elements of any row, column or diagonal is equal to a specific number. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose ... Read More

Check if a Matrix is Involutory or not in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 15:55:54

165 Views

Matrices are nothing but a collection of data elements arranged in a rectangular layout that is two-dimensional. In Java, an array with two dimensions can be considered as a matrix. Involutory matrix is a square matrix which when multiplied by itself, gives back an identity matrix. Identity matrix is a matrix in which all elements are zero except the diagonals which are one. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose we have a matrix | 1 0 ... Read More

Check if a Matrix is Markov Matrix or not in Java

Mr. Satyabrata
Updated on 06-Mar-2023 11:56:16

1K+ Views

Matrices are nothing but it’s more than a collection of data elements arranged in a rectangular layout that is two-dimensional. In Java, an array with two dimensions can be considered as a matrix. A square matrix is called a Markov matrix if all entries are nonnegative and the sum of each column vector is equal to 1. The Markov matrix represents steps in a Markov chain. Each input of the Markov matrix represents the probability of an outcome. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some ... Read More

Check if a Matrix is Identity Matrix or not in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 11:45:28

966 Views

Matrices are nothing but it’s more than a collection of data elements arranged in a rectangular layout that is two-dimensional. In Java, an array with two dimensions can be considered as a matrix. Identity matrix is a square matrix which has all 1s as its principal diagonal elements and rest are 0s. As per the problem statement we have to0 check if the given matrix is Identity matrix or not. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose we have a matrix ... Read More

Find Two Array Elements Having Maximum Sum in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 11:41:12

2K+ Views

Two elements giving the maximum sum in an array means, we have to find two largest array elements which will eventually give the maximum sum possible. In this article we will see how we can find the maximum sum of two elements in Java. To show you some instances Instance-1 Suppose we have the below array [10, 2, 3, -5, 99, 12, 0, -1] In this array the largest element is 99 and second largest is 12. Max sum = 99 + 12 Hence the maximum sum of two elements in this array is 111. Instance-2 Suppose we have the ... Read More

Find Two Array Elements Having Maximum Product in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 11:33:04

929 Views

Two elements giving the maximum product in an array means, we have to find two largest array elements which will eventually give the maximum product possible. In this article we will see how we can find the maximum product of two elements in Java. To show you some instances Instance-1 Suppose we have the below array [10, 2, 3, -5, 99, 12, 0, -1] In this array the largest element is 99 and second largest is 12. Max product = 99 * 12 Hence the maximum product of two elements in this array is 1188. Instance-2 Suppose we have the ... Read More

Find Scalar Multiplication of a Matrix in Java?

Mr. Satyabrata
Updated on 06-Mar-2023 11:23:01

453 Views

In Java, Array is an object. It is a non-primitive data type which stores values of similar data type. The matrix in java is nothing but a multi-dimensional array which represents multiple rows and columns. Scalar multiplication is nothing but multiplication between a matrix and a real number. The result of this multiplication is in matrix format. As per the problem statement, we have to find the scalar multiplication of a matrix. Let’s deep dive into this article, to know how it can be done by using Java programming language. To show you some instances Instance-1 Suppose the original matrix ... Read More

Advertisements