Download Chapter 2: Introduction to Microprocessor

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript




DATA
DATA STRUCTURE
LINEAR DATA STRUCTURE
NON-LINEAR DATA STRUCTURE
DATA


Applications/programs read data, store data
temporarily, process it and finally output
results.
What is data? Numbers, Characters, etc.
Data
Application/
Program
Information



Data is classified into data types. e.g. char,
float, int, etc.
A data type is (i) a domain of allowed values
and (ii) a set of operations on these values.
Compiler signals an error if wrong
operation is performed on data of a certain
type. For example, char x,y,z; z = x*y is not
allowed.
BACK
The Structural Organization of data is called as a
Data Structure Or Data Structure is a collection of
organized data that are related to each other. Data
Structures can be classified in two ways those are:
1. Linear Data Structure(array, stack, queue)
2. Non-Linear Data Structure(graphs, Trees)
BACK
•
The Representation of Data in a linear Order in the
data structure is called as linear data structure.
•
Arrays are the best example for linear data structure
because in array all the elements are homogeneous
and linear.
10
20
30
40
50
60
70
80
•
10,20….80 are called as elements of the array.
•
The array index is starts from 0 and ends with n-1.

A stack is a linear data structure.

In a stack all the elements insert and delete


Pop()
Push()
from only one end that is called as top of the
10
stack.
20
A
stack
follows
LIFO(Last
In
First
Out)
30
40
mechanism.
50
The stack data structure is mostly used in
60
system softwares.

Data insert into stack using push() operation.

Data delete from stack using pop() operation.
70
80
•
A Queue is a linear data structure.
•
The queue having two ends, one is front end
and rear end.
•
The front end is used to insert the data into
queue.
•
The rear end is used to delete the data from
queue.
•
The queue follows FIFO(First In First Out)
Mechanism.
•
Data insert into queue using push() operation.
•
Data delete from queue using pop() operation.
Push()
Pop()
10 20 30 40 50 60
•
•
•
Linked List is a linear Data structure.
Linked List contains list of nodes. Each node contains
two parts:
1. Data Part
2. Address of Next Node (Link to next node in
the list)
The nodes in the linked list represents in terms of
structures.
aman 101
100
aarav
102
101
arya
^
102
BACK
•
The data structure which is used to store the data in
non-linear order is called as non-linear data structure.
•
Trees and Graphs are the most popular non-linear data
structures.
•
In trees, it has one root node and child nodes. Each root
node having two child nodes those, left child and right
child nodes.
•
A graph is a set of nodes and set of edges.
•
The edges are formed when the nodes are non-linearly
connected among them.
•
A Tree is a non-linear data structure.
•
Each Tree can have one root node and child
A
nodes. Left child and right child.
•
The ending elements of the tree is called as
•
Terminal nodes don’t have any child node.
•
Accessing of a tree elements is called tree
traversing.
•
Each sub-tree of a tree itself is a tree.
•
The number of vertical positions in the tree is
called height of the tree.
C
B
terminal nodes.
D
EF
G
•
A Graph is a non-linear Data structure.
•
A graph is a set of nodes and edges. The edge is
Connected
Graph
A
B
formed when two nodes are connected among
them.
•
A Graph is connected Graph when the path existed
between any two nodes in the graph. In connected
graph each node can have two paths (incoming,
outgoing).
•
A Graph is non-connected Graph when a node can
have only one path then graph is called as nonconnected graph.
BACK
D
C
A
B
Non-Connected
Graph
D
C
BACK