Sie sind auf Seite 1von 15

Data Structure

Diomar S. Orbase
What is Data Structure?
Data Structure


Data Structure
– A data structure is a logical way to store
and organize data so that it can be used
efficiently.

Diomar S. Orbase
Why Data Structure is
Important?
Why Data Structure is
Important?


To solve the complex requirements in efficient way
we need this study to provide fastest solution of
human requirements. And also it
● Provide efficient solution of complex problem.
– Space
– Time

Diomar S. Orbase
Classification of Data Structure

Data Structure

Linear Data Structures Non-Linear Data Structures

Array Linked List Stack Queue Tree Graph

Diomar S. Orbase
2 Types of Data Structure

● Linear Data Structures: A linear data structure traverses the


data elements sequentially, in which only one data element can
directly be reached. Ex: Arrays, Linked Lists, Stack, Queue.


Non-Linear Data Structures: Every data item is attached to
several other data items in a way that is specific for reflecting
relationships. The data items are not arranged in a sequential
structure. Ex: Trees, Graphs

Diomar S. Orbase
Operation on Linear/Non-Linear
Data Structure
● Add an element
● Delete an element
● Traverse / Display
● Sort the list of elements
● Search for a data element

Diomar S. Orbase
Linear Data Structure

● Array: An array is a collection of data types of similar type.

Size: 10
35 33 42 10 14 19 27 44 26 31
0 1 2 3 4 5 6 7 8 9

Diomar S. Orbase
Linear Data Structure

Stack: It is a LIFO(Last In First


Out) data structure where the
data added last (PUSH) is
removed first (POP).

Diomar S. Orbase
Linear Data Structure

Queue: It is a FIFO (First In


First Out) data structure where
data added first is removed
first.

Diomar S. Orbase
Linear Data Structure

Linked List: It is a collection of nodes, where each node is


made up of a data element and a reference to the next node in
sequence.
Non-Linear Data Structure
Tree: A Tree is a data structure that is made up of a set of
linked nodes. It emulates a hierarchical tree structure and
form a parent
A

B C

D E F

Diomar S. Orbase
Non-Linear Data Structure

Graph: Is a collection of finite number of vertices and edges


that connect the vertices. Edges represents relationship
among vertices that stores data elements.

0 1
2
4 3

Diomar S. Orbase
Differences Between Linear and
Non-Linear Data Structure

Diomar S. Orbase

Das könnte Ihnen auch gefallen