Java Program to find the transpose of a given matrix17 Mar 2025 | 2 min read In this program, we need to find the transpose of the given matrix and print the resulting matrix. Transpose of MatrixTranspose of a matrix can be found by interchanging rows with the column that is, rows of the original matrix will become columns of the new matrix. Similarly, columns in the original matrix will become rows in the new matrix. The operation can be represented as follows: ![]() If the dimension of the original matrix is 2 � 3 then, the dimensions of the new transposed matrix will be 3 � 2. Algorithm
ProgramOutput: Transpose of given matrix 1 4 7 2 5 8 3 6 9 Next TopicJava Programs |
An array or list inArr of the numbers (either negative or positive) is given. The task is to find the number of smaller elements that exist on the right side of the current element. The following examples are given for a better understanding. Example 1: Input int inArr[] =...
14 min read
Java Convert float to String We can convert float to String in java using String.valueOf() and Float.toString() methods. Scenario It is generally used if we have to display float value in textfield because everything is displayed as a string in form. 1) String.valueOf() The String.valueOf() is an overloaded method. It can...
1 min read
Java Program to find Smallest Number in an Array We can find the smallest element or number in an array in java by sorting the array and returning the 1st element. Let's see the full example to find the smallest number in java array. public class SmallestInArrayExample{ public static...
2 min read
In this program, we need to calculate the sum of nodes present in the binary tree. First, we will traverse through the left sub-tree and calculate the sum of nodes present in the left sub-tree. Similarly, we calculate the sum of nodes present in the...
4 min read
In this program, we need to rotate the elements of array towards its right by the specified number of times. An array is said to be right rotated if all elements of the array are moved to its right by one position. One approach is...
4 min read
We can capitalize each word of a string by the help of split() and substring() methods. By the help of split("\\s") method, we can get all words in an array. To get the first character, we can use substring() or charAt() method. Let's see the example...
1 min read
In this program, we need to find the duplicate characters in the string. Great responsibility To find the duplicate character from the string, we count the occurrence of each character in the string. If count is greater than 1, it implies that a character has a duplicate...
3 min read
Java Program to Count the Total Number of Punctuation Characters Exists in a String In the ious Java string programs, we have counted the number of words, white spaces, vowels, consonants, and characters. Sometimes it also becomes necessary to count the total number of punctuations in...
2 min read
In this program, we will create a doubly linked list and insert every new node at the end of the list. If the list is empty, then head and tail will point to newly added node. If list is not empty then, insert the new...
5 min read
Program to Print the Duplicate Elements of an Array | Find Duplicate Elements in an Array in Java Finding duplicate elements in an array is a commonplace programming hassle that assesses the know-how of statistics systems and algorithms. Understanding the different methods to find duplicates efficiently is...
9 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India