0% found this document useful (0 votes)
24 views

Lecture 2 - Introduction To Data Strutures

This document provides an introduction to data structures. It defines data as individual facts or items of information, while information is processed or structured data. Data needs to be organized using data structures so it can be meaningfully used. Data structures determine how data is physically represented and organized in memory. Examples of data structures include arrays, stacks, queues, linked lists, trees and graphs. The document also discusses primitive and non-primitive data types, abstract data types, and linear vs non-linear data structures.

Uploaded by

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

Lecture 2 - Introduction To Data Strutures

This document provides an introduction to data structures. It defines data as individual facts or items of information, while information is processed or structured data. Data needs to be organized using data structures so it can be meaningfully used. Data structures determine how data is physically represented and organized in memory. Examples of data structures include arrays, stacks, queues, linked lists, trees and graphs. The document also discusses primitive and non-primitive data types, abstract data types, and linear vs non-linear data structures.

Uploaded by

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

Lecture 2

Introduction to Data Structures


Data

Dictionary Definition:

The quantities, characters or symbols on which


operations are performed by a computer, which may be
stored and transmitted in the form of electrical signals
and recorded magnetic, optical or mechanical recording
media.

c=a+b
Introduction

• Data – individual facts, statistics or items of information.

E.g. MAR SI EMAN YM

• Information – processed, organized or structured data.

E.g. MY NAME IS RAM


Introduction

The data needs to be managed in such a way so that it can


produce some meaningful information.

To provide an appropriate way to structure the data, we need


to know about

DATA STRUCTURES
Introduction

Data Structure ~ physical representation of how the data


items are organised and manipulated in the memory.

Example : Arrays

Instead of creating multiple variables of the same datatype.


We can create an array and store all values.
Introduction

• Data Structure logically addresses two


fundamental concerns ~

• How the data will be stored ?

• What operations will be performed on it ?


Examples in Real Life

• Storing an image.

• Redo and Undo feature.

• Maintaining browsing history.

• Social Network.

• Print Jobs

• Handling messages I chat applications


Introduction

• Datatype ~ classification of data which tells the compiler


or interpreter how the programmer intends to use the
data.

• Defines a certain domain of values.

• Defines operations allowed on those values.


Introduction

E.g. your name – a string of characters


e.g: “Ram”

your age – usually an integer


e.g: 20

the amount of money in your pocket – usually a value


measured in rupees (something with a
fractional part-float)
e.g: Rs. 1200.50

• Each datatype requires different amounts of memory.


Introduction

User Defined Datatypes – The operations and values of


user defined data types are not specified in the language
but is specified by the user.

Example: Structure, Union and Enumeration


Introduction

• Abstract Data Type (ADT) ~ ADTs are user defines data


types which defines operations on values using functions
without specifying what is inside the function and how
operations are performed.

• The abstract view of a television:

• Ability to change channels, adjust the volume.


• TV displays the show we want to watch.

• Don't care: who made the TV, or how circuit inside


was constructed.
Introduction

• ADTs are entities that are definitions of data and


operations but do not have implementation details.

User
Interface

Implementation
Data Structure

Organization of the data so that it can be used efficiently.

It is used to implement an ADT.

ADT tells us what needs to be done and Data Structures


tells us how to do it.
Data Structure Hierarchy
Primitive Data Structures

• Basic data structures that directly operate upon machine


instructions.

• Different representations across computers.

• Stores data of only one type.

• Available in most programming languages as built-in


datatype.

• E.g. : Integer, float, character, etc.


Non-primitive Data structure

Sophisticated data structures derived from primitive data


structures.

• Can be linear or non-linear.

• Emphasize on structuring of a group of homogeneous


or heterogeneous data items.

• E.g. Array, Stack, List, etc.


Linear Data Structures

• A linear data structure has all the data elements arranged


in a sequential manner and each member element is
connected to its previous and next element.

• Array, Linked list, Stack, Queue


Non-Linear Data Structures

Non-linear data structures where data elements are not


arranged specifically in sequence are non-linear data
structures.
• Trees, Graphs
Questions ?

You might also like