0% found this document useful (0 votes)
37 views30 pages

Introduction To Data Structures: By-Dr. Shweta R. Malwe Assistant Professor Area of CSE

This document provides an introduction to data structures. It defines data structures as representations of the logical relationships between data elements that consider both the stored elements and their relationships. It classifies data structures as either primitive or non-primitive, and lists common examples such as integers, characters, arrays, linked lists, stacks, queues, trees, and graphs. Finally, it describes some common operations on data structures like creation, selection, updating, searching, sorting, merging, and deletion.

Uploaded by

Aryan Apte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views30 pages

Introduction To Data Structures: By-Dr. Shweta R. Malwe Assistant Professor Area of CSE

This document provides an introduction to data structures. It defines data structures as representations of the logical relationships between data elements that consider both the stored elements and their relationships. It classifies data structures as either primitive or non-primitive, and lists common examples such as integers, characters, arrays, linked lists, stacks, queues, trees, and graphs. Finally, it describes some common operations on data structures like creation, selection, updating, searching, sorting, merging, and deletion.

Uploaded by

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

Introduction to Data Structures

By-

Dr. Shweta R. Malwe


Assistant Professor
Area of CSE
Basic Terminologies
• Data Structure

• Data: a value or set of values of different type which is


called data types like string, integer, char etc.

• Structure: Way of organizing information, so that it is


easier to use.
Definition
• Data structure is representation of the logical relationship
existing between individual elements of data.

• In other words, a data structure is a way of organizing all


data items that considers not only the elements stored but
also their relationship to each other.
Introduction
• Program = Algorithm + Data Structure

• Algorithm is a step by step procedure to solve a particular


function.
Classification of Data Structure

• Data structure are normally divided into two broad categories:

• Primitive Data Structure


• Non-Primitive Data Structure
Classification of Data Structure
Data structure

Primitive DS Non-Primitive DS

Integer Float Character Pointer


Classification of Data Structure
Non-Primitive DS

Linear DS Non-Linear DS

Array Queue Graph Trees

Linked List Stack


Primitive Data Structure

• There are basic structures and directly operated


upon by the machine instructions.

• Integer, Floating-point number, Character


constants, string constants, pointers etc, fall in
this category.
Non-Primitive Data Structure
• There are more sophisticated data structures.
• These are derived from the primitive data
structures.
• The non-primitive data structures emphasize on
structuring of a group of homogeneous (same
type) or heterogeneous (different type) data
items.
Operations in a Data Structure
• Traversing: accessing each record/node exactly once
so that certain items in the record may be processed.
• Inserting: Adding a new node/record to the structure.
• Deleting: Removing a node/record from the structure.
• Searching: Finding the location of the desired node
with a given key value.
Non-Primitive Data Structure
Commonly used operation on data structure
are :
• Creation
• Selection
• Updating
• Searching
• Sorting
• Merging
• Deletion
Description of various Data Structures :
Arrays
• An array is defined as a set of finite number of
homogeneous elements or similar data items.
Linked Lists

• A Linear linked list can be defined as a collection of


variable number of data items.

• Lists are the most commonly used non-primitive data


structures.
Linked List
Stack
Stack
• A stack is also an ordered collection of elements like
arrays, but it has a special feature that deletion and
insertion of elements can be done only from one end
called the top of the stack (TOP)

• Last In First Out type of data structure (LIFO).


Stack

• The stack can be implemented into two ways:

• Using arrays (Static implementation)


• Using pointer (Dynamic implementation)
Queue

10 20 30 40 50

front rear
Queue
• Queue are first in first out type of data structure (i.e.
FIFO)
• In a queue new elements are added to the queue from
one end called REAR end and the element are always
removed from other end called the FRONT end.
• The people standing in a railway reservation row are
an example of queue.
Queue

• The queue can be implemented into two ways:

• Using arrays (Static implementation)


• Using pointer (Dynamic implementation)
Trees
Trees

• Tree is non-linear type of data structure.

• It is mainly used to represent data containing a


hierarchical relationship between various
elements.
Binary Tree
Graph
Graph

• Graph is a mathematical non-linear data structure


capable of representing many kind of physical
structures.

• Definition: A graph G (V, E) is a set of vertices V


and a set of edges E.
Graph
• Example of graph:
6
v2 v5
v1 v3
10

v1 8 11
15
9 v2
v3 v4 v4

[a] Directed & [b] Undirected Graph


Weighted Graph
Selecting a Data Structure

• Analyse the problem


• Determine resource constraints
• Determine basic operations
• Select the data structure
Thank You

You might also like