data structure & its types

26
DATA STRUCTURE AND ITS TYPES PRESENTED BY RAMEESHA SADAQAT

Upload: rameesha-sadaqat

Post on 20-Jul-2015

47 views

Category:

Technology


2 download

TRANSCRIPT

DATA STRUCTURE AND

ITS TYPES

PRESENTED BY

RAMEESHA SADAQAT

CONTENTS

DEFINITION OF DATA STRUCTURES

DATA STRUCTURE OPERATIONS

TYPES OF DATA STRUCTURE

LINEAR DATA STRUCTURE

NON-LINEAR DATA STRUCTURE

DEFINITION OF

DATA

STRUCTURES

It is a logical way of storing data and it also define mechanism of retrieve data.

DATA STRUCTURE

OPERATIONS

Traversing: Accessing each record exactly once so that certain item in the record may be processed.

Searching: finding the location of the record with a given key value .

Insertion :adding a new record to the structure

Deletion : removing a record from the structure

Types of data structure

TYPES OF DATA

STRUCTURE

•NON-LINEAR• LINEAR

LINEAR DATA STRUCTURE

ARRAY

LINKED LIST

STACK

QUEUE

ARRAY An array is a collection of

homogeneous type of data elements.

An array is consisting of a collection of elements .

REPRESENTATION OF ARRAY IN MEMORY

1

2

3

4

5

OPERATIONS PERFORMED

ON AN ARRAY

Traversing

Searching

Insertion

Deletion

Sorting

Merging

ARRAY REPRESENTATION

LINKED LIST

A Linked list is a linear collection of data elements .It has two part one is info and other is link part.info part gives information and link part is address of next node.

OPERATIONS PERFROMED

ON LINKED LIST

Traversing

Searching

Insertion

Deletion

LINKED LIST

REPRESENTATION

stack (lifo)

A Stack also called last in first out (LIFO) system.

A Stack is a list of elements in which an element may be inserted or deleted at one end which is known as TOP of the stack.

EEE TOP

DDD

CCC

BBB

AAA

Operations performed

on stack

Push: add an element in stack

Pop: remove an element in stack

stack representation

queue (fifo)

A Queue also called first in first out (FIFO) system.

A queue is a linear list of element in which insertion can be done at one end which is known as front and deletion can be done which is known as rear.

3 2 1

Operations performed

on queue

Insertion : add a new element in queue.

Deletion: Removing an element in queue.

Queue representation

Non-linear data

structure

TREE

GRAPH

TREE Data frequently contain a hierarchical

relationship between various elements. The data structure which reflects this relationship is called tree.

Operations performed

on tree

Insertion

Deletion

Searching

Tree representation

graph Data sometimes contain a relationship

between pairs of elements which is not necessarily hierarchical in nature.

For example, an airline flies only between cities connected by lines.

Operations performed

on graph

Searching

Insertion

Deletion

graph representation