0% found this document useful (0 votes)
22 views

Discrete Math

The document compares and contrasts list structures and matrix structures. It describes four types of list structures - singly linked lists, doubly linked lists, circular linked lists, and array lists. It explains their characteristics, properties, and common operations. It then defines what a matrix is and describes common matrix operations like addition, subtraction, multiplication, and transpose. It also discusses types of matrices including square, diagonal, identity, symmetric, and sparse matrices.

Uploaded by

Mari Maramag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Discrete Math

The document compares and contrasts list structures and matrix structures. It describes four types of list structures - singly linked lists, doubly linked lists, circular linked lists, and array lists. It explains their characteristics, properties, and common operations. It then defines what a matrix is and describes common matrix operations like addition, subtraction, multiplication, and transpose. It also discusses types of matrices including square, diagonal, identity, symmetric, and sparse matrices.

Uploaded by

Mari Maramag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

LIST STRUCTURE

AND
MATRIX STRUCTURE

GROUP 4 PRESENTATION
LIST STRUCTURE
WHAT IS LIST STRUCTURE?
A list structure, also known as a linear data structure, is a way of organizing and storing data elements
sequentially. It is a collection of elements where each element contains a value and a reference (or link)
to the next element in the sequence. Lists are flexible and allow for dynamic resizing, making them
useful in various programming scenarios.

CHARACTERISTICS AND PROPERTIES


List Structure is mutable, allowing for modifications such as adding, removing, or modifying elements.
Lists can accommodate elements of different data types, making them heterogeneous. They have a
variable length, meaning that elements can be dynamically added or removed. Elements within a list
can be accessed using their index, enabling efficient retrieval and manipulation. Lists also allow for
duplicates, meaning that multiple occurrences of the same element can be included. Lists are iterable,
which means that they can be traversed using loops or other iteration methods, making it easy to
perform operations on each element. These characteristics and properties make lists a flexible and
widely used data structure in programming.
TYPES LIST STRUCTURE

SINGLY LINKED LIST

DOUBLY LINKED LIST

CIRCULAR LINKED LIST

ARRAY LIST
SINGLY LINKED LIST
A singly linked list is a way to organize data
where each element, called a node, contains
both the actual data and a reference to the
next node in the list. It's like a chain of
connected nodes, allowing for efficient Node 1 Node 2 Node 3
insertion and deletion, but slower access to +-------+ +-------+ +-------+
specific elements compared to an array. | Data 1| --> | Data 2| --> | Data 3| --> NULL
+-------+ +-------+ +-------+
The structure of a singly linked list consists of
nodes connected in a linear manner. Each
node contains two main parts: the data or
value it holds and a reference or pointer to the
next node in the list. The last node in the list
points to NULL or nothing, indicating the end
of the list.
OPERATIONS OF SINGLY LINKED LIST

Insertion: Adding a new node to the list.

Insertion at the beginning:


Insertion at the end:
Insertion in the middle:

Deletion: Removing a node from the list.

Deletion at the beginning


Deletion at the end
Deletion in the middle

Traversal: Iterating through the list to access and process


each node's data.

Searching: Looking for a specific value in the list by


traversing the nodes and comparing the data values.
DOUBLY LINKED LIST
A doubly linked list is a data structure where each
node contains data and two pointers: one that
points to the previous node and another that points
to the next node. This allows for efficient traversal in
both directions and enables easy insertion and
deletion at both ends of the list.

The structure of a doubly linked list is similar to a


singly linked list, but each node has an additional
pointer that points to the previous node as well. This
creates a two-way connection between nodes,
allowing for traversal in both forward and backward
directions.

Doubly linked lists provide bidirectional traversal


and efficient deletion operations. However, they
come with increased memory usage and a more
complex implementation compared to singly linked
lists. The choice to use a doubly linked list depends
on the specific requirements of the application,
considering the trade-offs between functionality and
complexity.
OPERATIONS OF DOUBLY LINKED LIST

Insertion: Adding a new node to the list.


Insertion at the beginning
Insertion at the end
Insertion in the middle

Deletion: Removing a node from the list.


Deletion at the beginning
Deletion at the end
Deletion in the middle

Traversal: Iterating through the list in either forward or backward


direction to access and process each node's data.

Searching: Looking for a specific value in the list by traversing the


nodes in either direction and comparing the data values.

These are the basic operations involved in working with a doubly


linked list. The presence of both next and prev pointers allows for
more flexibility and efficient operations compared to a singly
linked list.
CIRCULAR LINKED LIST
A circular linked list is a type of data structure
where the last node in the list points back to
the first node, creating a circular arrangement.
It's like a loop where each node has a pointer
to the next node, and the last node connects
back to the first node.

The structure of a circular linked list is similar


to that of a singly linked list, with the addition
that the last node points back to the first node
instead of pointing to NULL. Each node in the
circular linked list contains data and a pointer
to the next node.
OPERATIONS OF CIRCULAR LINKED LIST

The operations commonly performed on a


circular linked list are similar to those of a
singly linked list, with slight adjustments to
account for the circular structure:

These are the basic operations involved in


working with a circular linked list. The circular
structure enables seamless traversal and
convenient operations on cyclical data
relationships.

Circular linked lists offer efficient operations


and easy traversal, but their complex
implementation and lack of random access
make them less suitable for certain use cases.
ARRAY LIST
An array list is a list structure that stores
elements in a contiguous block of memory. It
allows for dynamic resizing and provides
efficient random access to elements. The
array list provides the flexibility of dynamically
adding and removing elements, while still
offering constant-time access to any element
by its index.

The structure of an array list consists of a


contiguous block of memory where elements
are stored. Each element is typically of the
same data type and occupies a fixed amount
of memory.
OPERATION OF ARRAY LIST

Insertion: New elements can be inserted at


any position within the array list.

Access: Elements in an array list can be


accessed using their index.

Deletion: Elements can be removed from the


array list by specifying their index.

Dynamic resizing: Array lists have the ability to


dynamically resize themselves as elements
are added or removed. .

Random access: Array lists provide efficient


random access to elements.

Overall, the array list combines the flexibility of


dynamic resizing with efficient random access,
making it a popular choice for storing and
manipulating collections of elements in many
programming languages.
ARRAY LIST

Array Lists provide efficient random access, dynamic resizing, and efficient
traversal. However, they have drawbacks such as costly insertions and
deletions, fixed capacity, and potentially inefficient removals. The choice to use
an ArrayList depends on the specific requirements of the application,
considering the trade-offs between efficient element access and modification
operations.
LINKED LIST ARRAY LIST
MATRIX STRUCTURE
200
The organization and representation of
X= 030
mathematical objects and operations 001
using matrices. Matrices are rectangular
arrays of numbers or symbols arranged in
rows and columns.. Row
2 0 0
Different Type of Matrix
-Square matrix Column 0 3 0
- Diagonal matrix 0 0 1
- Identity matrix
- Symmetric matrix
- Sparse matrix
X 3,1 = 0
OPERATION ON MATRIX STRUCTURE

Addition and Subtraction: In matrix addition and subtraction, matrices of the same size
are combined by adding or subtracting their corresponding elements. The resulting
matrix has the same dimensions as the original matrices.
ADDITION SUBTRACTION

1 2 3 5

3 4 2 4

+ -
5 6 1 2
7 8 3 1

= =
6 8 2 3

10 12 -1 3
OPERATION ON MATRIX STRUCTURE

Multiplication:

MULTIPLICATION

=
1 6

6 16
OPERATION ON MATRIX STRUCTURE

Transpose: The transpose of a matrix flips its rows and columns.


The rows become columns, and the columns become rows
TRANSPOSE

=
OPERATION ON MATRIX STRUCTURE

1 2
1 2
1*4= 4
3 4 A=
3 4 2*3= 6
4-6=2

SIMPLIFY
4 -2 4/2 -2/2 2 -1
1
A= =
2 -3 1 -3/2 1/2 -3/2 1/2
TYPES OF MATRIX STRUCTURE

SQUARE MATRIX
A square matrix is a type of matrix where the number of rows is equal to the number of columns. In other
words, a square matrix has the same number of rows as it has columns. The dimensions of a square matrix
are typically denoted as n x n, where n represents the number of rows (which is also equal to the number of
columns).
4

1 2 3 4
1 2 5 6 7 8
4
9 10 11 12
3 4
13 14 15 16

In this example, Matrix A is a 3x3 square matrix because it has 3 rows and 3 columns. Each
element in the matrix is identified by its row and column position. Square matrices are
commonly used in various mathematical operations, such as matrix multiplication, finding
determinants, and calculating matrix inverses.
TYPES OF MATRIX STRUCTURE

DIAGONAL MATRIX
A diagonal matrix is a special type of square matrix in which all the elements outside the
main diagonal (the diagonal from the top left to the bottom right) are zero. The main
diagonal elements can be any non-zero values. In other words, a diagonal matrix is a
matrix where the elements are non-zero only on the main diagonal, and all other elements
are zero.
4

1 0 0
0 6 0
4 0 0 1
1

NOTE: A diagonal matrix must be a square matrix, meaning it has an equal number of rows
and columns.
TYPES OF MATRIX STRUCTURE

IDENTITY MATRIX
An identity matrix is a special type of square matrix in which all the elements on the main
diagonal (from the top left to the bottom right) are equal to 1, and all the elements outside
the main diagonal are zero. The identity matrix is typically denoted by the symbol "I" or
"Iₙ," where "n" represents the dimensions of the matrix.

1 0 0

4 0 1 0

0 0 1

0 0 0

NOTE: In this example, all the elements on the main diagonal (1, 1, 1) are equal to 1, and
all other elements are zero.
TYPES OF MATRIX STRUCTURE

SYMMETRIC MATRIX
A symmetric matrix is a special type of matrix that exhibits symmetry with respect to its
main diagonal.

3 1 4

1 5 2

4 2 6

In this matrix, a12 = 1 and a21 = 1, a13 = 4 and a31 = 4, a23 = 2 and a32 = 2, and so on. The
elements below the main diagonal are mirror images of the elements above the main
diagonal.
TYPES OF MATRIX STRUCTURE

SPARSE MATRIX
A sparse matrix is a matrix that contains a large number of zero elements compared to the
total number of elements. In other words, most of the entries in a sparse matrix are zero.

0 0 9 5 0

0 0 0 0 0

0 0 6 0 0

4 0 0 0 0

0 0 0 0 1

Sparse matrices are often encountered in various fields such as scientific computing, data
analysis, and graph algorithms. Due to their significant number of zero elements, sparse
matrices can be represented and processed more efficiently using specialized techniques
that take advantage of their sparsity, as compared to dense matrices.
ABOUT OUR BUSINESS
The future is before us and dynamic. Everything we do will affect it.

221,001 141,316 510,009 400,010 210,005


Add Your Title Add Your Title Add Your Title Add Your Title Add Your Title
I think the Universe tends I think the Universe tends I think the Universe tends I think the Universe tends I think the Universe tends
to trust us to the degree we to trust us to the degree we to trust us to the degree we to trust us to the degree we to trust us to the degree we
trust ourselves. It is not trust ourselves. It is not trust ourselves. It is not trust ourselves. It is not trust ourselves. It is not
given to me to know how given to me to know how given to me to know how given to me to know how given to me to know how
many steps are necessary many steps are necessary many steps are necessary many steps are necessary many steps are necessary
in order to reach my goal. in order to reach my goal. in order to reach my goal. in order to reach my goal. in order to reach my goal.
LOGO

THANK YOU

You might also like