Multidimensional arrays & Functions

Lecture 5 - Multidimensional arrays & Functions

Functions

we can pass to a functions either by:

  • reference

  • value

Here we pass by value

public class Main {
    public static void printMe(int value_of_num) {
        System.out.println(value_of_num);
        value_of_num = 99;
    }


    public static void main(String[] args) {
        int num = 5;
        printMe(num);
        printMe(num);
    }
}

The function is void since it doesn't return a value

also here we pass by value

The function is int since we return a value

Exercise: Palindrome

Palindrome Program Explained. C-Programs to find a palindrome | by randerson112358 | Medium

Multidimensional arrays

Linear Algebra for Machine Learning | Master Data Science
Scalars, Vectors, Matrices and Tensors with Tensorflow 2.0 - DEV Community

Each array can be a different size

Exercise: print the matrix and its sum

Explanation:

here

arr is passed by

  • reference

  • and not by value

Exercise: Trace of matrix

Understand The Trace of a Matrix for Beginners - Deep Learning Tutorial

Exercise: Transpose

How to transpose a matrix in Java? Example Tutorial | Java67

Exercise: Check Symmetry of matrix

Symmetric Matrix & Skew Symmetric Matrix (Definition & Properties)
Introduction to diagonal and symmetric matrices, unit and orthogonal vectors using Python/Numpy examples and drawings

Matrix Multiplication

A Complete Beginners Guide to Matrix Multiplication for Data Science with Python Numpy | by Chris I. | Towards Data Science

Last updated

Was this helpful?