Two dimensional arrays A two dimensional m x n array A is a collection of m. n elements such that each element is specified by a pair of integers (such.

Slides:



Advertisements
Similar presentations
E LEMENTARY D ATA STRUCTURES. A RRAYS Sequence of elements of similar type. Elements are selected by integer subscripts. For example, signs: array[37:239]
Advertisements

CHP-5 LinkedList.
4.1 Introduction to Matrices
The simple built-in data types of the C language such as int, float, - are not sufficient to represent complex data such as lists, tables, vectors, and.
1 Section 7.3 Representing relations (part 1: matrices)
Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
Maths for Computer Graphics
Main Index Contents 11 Main Index Contents Pointer Illustration Pointer Illustration Vertical / Horizontal View. Vertical / Horizontal View. Data Addresses.
Main Index Contents 11 Main Index Contents Pointer Illustration Pointer Illustration Vertical / Horizontal View. Vertical / Horizontal View. Data Addresses.
Chapter 8 Arrays and Strings
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Module 6 Matrices & Applications Chapter 26 Matrices and Applications I.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Section 8.1 – Systems of Linear Equations
Chapter 1: Matrices Definition 1: A matrix is a rectangular array of numbers arranged in horizontal rows and vertical columns. EXAMPLE:
1 Systems of Linear Equations & Matrices Sections 4.2 & 4.3 After today’s lesson, you will be able to Use terms associated with matrices. Set up and solve.
Chap. 1 Systems of Linear Equations
Chapter 1 Systems of Linear Equations and Matrices
Little Linear Algebra Contents: Linear vector spaces Matrices Special Matrices Matrix & vector Norms.
Solving Systems of Equations by matrices
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
ARRAYS, RECORDS AND POINTER
CPS120: Introduction to Computer Science Arrays. Arrays: A Definition A list of variables accessed using a single identifier May be of any data type Can.
Data Strcutures.
13.1 Matrices and Their Sums
The Determinant of a Matrix Note: The determinant of a matrix can be positive, zero, or negative. Chapter 3 Determinants.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
Matrices and Systems of Equations
Matrices: Simplifying Algebraic Expressions Combining Like Terms & Distributive Property.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Section 3.5 Revised ©2012 |
Chapter 1 Systems of Linear Equations Linear Algebra.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
LEARNING OUTCOMES At the end of this topic, student should be able to :  D efination of matrix  Identify the different types of matrices such as rectangular,
C++ Array 1. C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used.
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
1. Traversing a linear array Here A is a linear array with lower bound LB and upper bound UB. This algorithm traverses A applying an operation PROCESS.
Linear Algebra Engineering Mathematics-I. Linear Systems in Two Unknowns Engineering Mathematics-I.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
Introduction Types of Matrices Operations
Matrices and systems of Equations. Definition of a Matrix * Rectangular array of real numbers m rows by n columns * Named using capital letters * First.
MATRICES A rectangular arrangement of elements is called matrix. Types of matrices: Null matrix: A matrix whose all elements are zero is called a null.
Linear Algebra by Dr. Shorouk Ossama.
7.1 Matrices, Vectors: Addition and Scalar Multiplication
1.5 Matricies.
EGR 115 Introduction to Computing for Engineers
Reminder: Array Representation In C++
Multiple Dimension Arrays
Reminder: Array Representation In C++
Introduction to Matrices
Linear Equations in Linear Algebra
MATRICES MATRIX OPERATIONS.
2.2 Introduction to Matrices
RECORD. RECORD COLLABORATE: Discuss: Is the statement below correct? Try a 2x2 example.
Presented By Farheen Sultana Ist Year I SEM
Arrays.
Matrices Introduction.
Matrices An appeaser is one who feeds a crocodile—hoping it will eat him last. Winston Churchhill.
DETERMINANT MATH 80 - Linear Algebra.
Section 8.1 – Systems of Linear Equations
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
Reminder: Array Representation In C++
Matrices and Determinants
Presentation transcript:

Two dimensional arrays A two dimensional m x n array A is a collection of m. n elements such that each element is specified by a pair of integers (such J, K) called subscripts with property that 1 <= J <= m 1 <= K <= n The element with first subscript j and subscript k is denoted by Aj,k or A[J,K] The elements of A form a rectangular array with m rows and n columns and the element A[J,K] appears in a row J and column K

A row is a horizontal list of elements A column is a vertical list of elements Representation of 2D Arrays in memory Although A is pictured as a rectangular array of elements with m rows and n columns, but the array will be represented in memory by a block of m. n sequential memory locations. Array can be stored in two ways 1.Column major order 2.Row major order

In column major order elements are stored column by column In row major order elements are stored row by row How To find the address of element A[J,K] in 2D m x n array A we can use following formulae For column major order: LOC(A[J,K]) = Base(A) + w ( M(K-1) + (J-1) ) For row major order: LOC(A[J,K]) = Base(A) + w ( N(J-1) + (K-1) ) w denotes the no. of words per memory location

Pointers & Pointer Arrays Let DATA be any array a variable ‘P’ is called pointer if P points to an element in DATA, i.e. if P contains the address of an element in DATA. An array “PTR” is called pointer array if each element of array is pointer.

Records & Record Structures Define record? Field? File? Elementary data items? Group data items?

A record is a collection of related data items, each of which is called a field or attribute and a file is collection of similar record.

Representation of records in memory ; Parallel Arrays Since records may contain non homogeneous data, the elements of record cannot be stored in an array; but some programming languages have record structures built into the language. But if structures are not available, and our record contains non homogeneous data, then we can store the elements in different arrays with same subscript belong to the same record…… this represents the parallel array……

Matrices and Vectors An n-element vector V is a list of n numbers usually given in the form V = (V1, V2, V3, ……., Vn) An m x n matrix A is an array of m. n numbers arranged in m rows an n columns Sparse Matrices : matrices with relatively high proportion of zero entries are called Sparse Matrices.

Triangular matrices : the matrix where all entries above the main diagonal are zero, or equivalently where non zero elements can only occur on or below the main diagonal is called a triangular matrix. Tridiagonal matrix : the matrix where non zero entries can only occur on the diagonal is called tridiagonal matrix.