Graph Representation using Incidence List in Java

This is a java program to represent graph as a incidence list. The incidence matrix of G is a n × m matrix (b_{ij}), where n and m are the numbers of vertices and edges respectively, such that b_{ij} = 1 if the vertex v_i and edge x_j are incident and 0 otherwise. If this … Read more

advertisement

Graph Representation using Adjacency Matrix in Java

This is a java program to represent graph as a adjacency matrix. Nodes are arranged in matrix and at an index of i, j zero is displayed if nodes i and j are not connected, one otherwise. Here is the source code of the Java Program to Represent Graph Using Adjacency Matrix. The Java program … Read more

advertisement

Graph Representation using Adjacency List in Java

This is a java program to represent graph as a adjacency list. Each node will have a linked list consisting of node to which it is connected. Here is the source code of the Java Program to Represent Graph Using Adjacency List. The Java program is successfully compiled and run on a Windows system. The … Read more

advertisement

Java Program to Permute All Letters of an Input String

This is the Java Program to Print all Possible Permutations of a String. Problem Description Given a string, print all the different words that can be formed by permuting its letters. Example: String str =”ABC”; Output = ABC ACB BAC BCA CAB CBC Problem Solution The solution to this problem is based on the programming … Read more

advertisement

Java Program to Perform LU Decomposition of Any Matrix

This is a java program to LU Decomposition of a given matrix. LU decomposition is the process of reducing single matrix into 2 matrices such that, upon multiplication we get the original matrix, having property that one of them is lower trinagular matrix and other one is upper trinagular matrix. Here is the source code … Read more

advertisement

Java Program to Represent Linear Equations in Matrix Form

This is java program to convert the system of linear equations to matrix form. The input is the coefficient of each variable and constant. Class rearranges them and converts them into matrix form, which aids solving them. Here is the source code of the Java Program to Represent Linear Equations in Matrix Form. The Java … Read more

advertisement

Java Program to Find GCD and LCM of Two Numbers

This is java program to find the gcd and lcm of given two numbers. GCD is calculated using Euclidean Algorithm. LCM is found using factorization method. Here is the source code of the Java Program to Find the GCD and LCM of n Numbers. The Java program is successfully compiled and run on a Windows … Read more

advertisement

Java Program to Perform Message Encoding Using Matrix Multiplication

This is a java program to encrypt a matrix using a key. The key is hidden and kept secret and inverse copy of the key is provided to the receiver, with which he/she can decrypt the matrix. The operation performed is matrix multiplication. Here is the source code of the Java Program to Perform Encoding … Read more

advertisement

Java Program to Find the Determinant of a Matrix

This is the Java Program to Find the Modulus of a Matrix. Problem Description Given a square matrix, find and print the modulus(determinant) of the matrix. Example: Matrix: 1 2 3 4 5 6 7 8 9 Output: Modulus = 0 Problem Solution The algorithm for calculating modulus of 3*3 matrix is x=(matrix[0][0] * (matrix[1][1] … Read more

advertisement

Java Program to Find Basis and Dimension of a Matrix

This is the java program to find whether the vectors entered by users form the basis for the given dimension. The result for the same can be obtained by checking whether the determinant of the matrix formed by vectors is zero or not. If the determinant is non zero its forms the basis for the … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.