Data Structure Week 1-Overview of Data Structures
Data Structure Week 1-Overview of Data Structures
SEN209
Overview of Data Structures
SEN209
Overview of Data Structures
What is Data and Data Structure?
Data is the basic entity or fact that is used in computation or manipulation process.
Data are classified into:
Data
Structures
Data can be single or a set of values and
It is to be organized in a particular fashion.
A data structure is basically a group of data elements that are put together under one name
and which provides an efficient way of storing and organizing data in a computer so that it
can be used efficiently.
Data structures are generally classified into primitive and non-primitive data structures.
SEN209
Overview of Data Structures
Data
Structures
SEN209
Overview of Data Structures
Data Structure?
Data structure is the structural representation of logical relationships between elements of
data.
In other words, a data structure is a way of organizing data items by considering its
relationship to each other.
Data Mathematically;
Structures
Data structure mainly specifies the structural organization of data, by providing accessing
methods with correct degree of associativity.
Data structure affects the design of both the structural and functional aspect of a program.
SEN209
Overview of Data Structures
SEN209
Overview of Data Structures
8
Overview of Data Structures
Structures Insertion and deletion are not possible in a linear data structure
Non-primitive data structures can contain homogenous (same types) or heterogeneous
(different types) data items
9
Overview of Data Structures
11
Overview of Data Structures
12
Overview of Data Structures
13
Overview of Data Structures
14
Overview of Data Structures
15
Overview of Data Structures
Limitation of Arrays
Arrays are of fixed size
Data elements are stored in contiguous memory locations which may not be always
available
Array Data
Insertion and deletion of elements can be problematic because of shifting of elements
Structure from their positions.
Insertions and deletions can be at the beginning, at the end or at the middle of the array
However, these limitations can be solved by using linked list
16
Overview of Data Structures
17
Overview of Data Structures
18
Overview of Data Structures
20
Overview of Data Structures
Suppose, A is a two-dimensional m x n array. The first dimension of A contains the index set 1, 2,
….,m with lower bound 1 and upper bound m and the second dimension of A contains the index set
1, 2, …, n with lower 1 and upper bound n.
21
Overview of Data Structures
22
Overview of Data Structures
23
Overview of Data Structures
Memory The memory allocation is done column by column. That is column 1 is stored completely
Management before column 2.
24
Overview of Data Structures
25
Overview of Data Structures
27
Overview of Data Structures
28
Overview of Data Structures
Traversal operation
Traverse operation simply goes through the elements of the array and print them.
Array Data
Structure
29
Overview of Data Structures
30
Overview of Data Structures
Data
Structure
31
Overview of Data Structures
Update operation
The update operation simply modifies an item in the array.
Array Data
Structure
32
Overview of Data Structures
Search operation
The search operation simply check for the present of an item in the array. Searching can
be done by value or index.
Searching by value
Array Data
Structure
33
Overview of Data Structures
34
Then add the new elements using the index
Overview of Data Structures
Array Data
Structure
35
Overview of Data Structures
36
Overview of Data Structures
Array Data
Structure
37
Overview of Data Structures
Array Data
Structure
38
Overview of Data Structures
Array Data
Structure
39
40
THANK YOU
FOR
LISTENING
THE END