SlideShare a Scribd company logo
1
Abstract Data Types
2
Abstract Data Types
Abstract Data Type (ADT): a definition for
a data type solely in terms of a set of
values and a set of operations on that data
type.
Each ADT operation is defined by its
inputs and outputs.
ENCAPSULATION: Hide Implementation
details
3
Def.
e.g. whole numbers (integers) and arithmetic operators for addition,
subtraction, multiplication and division.
e.g. Flight reservation
Basic operations: find empty seat, reserve a seat,
cancel a seat assignment
Why "abstract?"
Data, operations, and relations are studied
independent of implementation.
What not how is the focus.
a collection of related data items
together with
an associated set of operations
Abstract Data Types
4
Def. Consists of
storage structures (data structures)
to store the data items
and
algorithms for the basic operations.
The storage structures/data structures used in implementations are
provided in a language (primitive or built-in) or are built from the
language constructs (user-defined).
In either case, successful software design uses data abstraction:
Separating the definition of a data type from its implementation.
Abstract Data Types
5
Data Structure
A data structure is the physical implementation of an
ADT.
Each operation associated with the ADT is implemented by one
or more subroutines in the implementation.
Data structure usually refers to an organization of data
in main memory.
File structure is an organization for data on peripheral
storage, such as a disk drive.
6
Data Type
ADT:
Type
Operations
Data Items:
Logical Form
Data Items:
Physical Form
Data Structure:
Storage Space
Subroutines
7
Simple Data Types
Memory:
2-state devices ↔ bits 0 and 1
Organized into bytes (8 bits) and
words (machine dependent — e.g., 2 bytes).
Each byte (or word) has an address making it possible to store and retrieve
contents of any given memory location.
Therefore:
the most basic form of data: sequences of bits
simple data types (values are atomic — can't be subdivided) are ADTs.
Implementations have:
» Storage structures: memory locations
» Algorithms: system hardware/software to do basic operations.
8
Boolean data
Data values: {false, true}
In C/C++: false = 0, true = 1 (or nonzero)
Operations: and &&
or ||
not !
x !x
0 1
1 0
&& 0 1
0 0 0
1 0 1
| | 0 1
0 0 1
1 1 1
9
Character Data
Store numeric codes (ASCII, EBCDIC, Unicode)
1 byte for ASCII and EBCDIC,
2 bytes for Unicode
Basic operation: comparison to determine ifEqual, Less than ,Greater
than, etc. use their numeric codes (i.e. use ordinal value)
ASCII/EBCDIC
Unicode
10
Integer Data
Non-negative (unsigned) integer:
Store its base-two representation in a fixed number w of bits
(e.g., w = 16 or w = 32)
88 = 00000000010110002
Signed integer:
Store in a fixed number w of bits using one of the following representations:
11
Sign-magnitude representation
Save one bit (usually most significant) for sign
(0 = +, 1 = – )
Use base-two representation in the other bits.
88 → _0000000010110000
↑
sign bit
Cumbersome for arithmetic computations
–88 → _000000001011000
↓
1
12
Two's complement representation
For negative n (–n):
(1) Find w-bit base-2 representation of n
(2) Complement each bit.
(3) Add 1
Example: –88
1. 88 as a 16-bit base-two number 0000000001011000
Same as
sign mag.For nonnegative n:
Use ordinary base-two representation with leading (sign) bit 0
2. Complement this bit string
3. Add 1
1111111110100111
1111111110101000
(Flip all bits from rightmost 0 to the end)

More Related Content

What's hot

Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
Elavarasi K
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Poojith Chowdhary
 
Aggregate fact tables
Aggregate fact tablesAggregate fact tables
Aggregate fact tables
Siddique Ibrahim
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
Kathirvel Ayyaswamy
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
Tech_MX
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its types
Rameesha Sadaqat
 
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptxPolynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Albin562191
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structures
Niraj Agarwal
 
1.7 data reduction
1.7 data reduction1.7 data reduction
1.7 data reduction
Krish_ver2
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
Knoldus Inc.
 
Density Based Clustering
Density Based ClusteringDensity Based Clustering
Density Based Clustering
SSA KPI
 
Decision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learningDecision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learning
Abhishek Vijayvargia
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
Ankit Rai
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMS
YouQue ™
 
Data Structures (BE)
Data Structures (BE)Data Structures (BE)
Data Structures (BE)
PRABHAHARAN429
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
LavanyaJ28
 
Clustering in data Mining (Data Mining)
Clustering in data Mining (Data Mining)Clustering in data Mining (Data Mining)
Clustering in data Mining (Data Mining)
Mustafa Sherazi
 
supervised learning
supervised learningsupervised learning
supervised learning
Amar Tripathi
 

What's hot (20)

Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Aggregate fact tables
Aggregate fact tablesAggregate fact tables
Aggregate fact tables
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
Data structure & its types
Data structure & its typesData structure & its types
Data structure & its types
 
Polynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptxPolynomial reppresentation using Linkedlist-Application of LL.pptx
Polynomial reppresentation using Linkedlist-Application of LL.pptx
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structures
 
1.7 data reduction
1.7 data reduction1.7 data reduction
1.7 data reduction
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
 
Density Based Clustering
Density Based ClusteringDensity Based Clustering
Density Based Clustering
 
Decision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learningDecision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learning
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMS
 
Data Structures (BE)
Data Structures (BE)Data Structures (BE)
Data Structures (BE)
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
 
Clustering in data Mining (Data Mining)
Clustering in data Mining (Data Mining)Clustering in data Mining (Data Mining)
Clustering in data Mining (Data Mining)
 
supervised learning
supervised learningsupervised learning
supervised learning
 

Viewers also liked

Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
Reggie Niccolo Santos
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Luis Goldster
 
11 abstract data types
11 abstract data types11 abstract data types
11 abstract data types
jigeno
 
Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)
eShikshak
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
Andres Mendez-Vazquez
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Hoang Nguyen
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Harry Potter
 
Lec3
Lec3Lec3
Lec3
Saad Gabr
 
Chapter03
Chapter03Chapter03
Chapter03
春男 洪
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Tony Nguyen
 
Stacks and queue
Stacks and queueStacks and queue
Stacks and queue
Amit Vats
 
Stacks, Queues, Deques
Stacks, Queues, DequesStacks, Queues, Deques
Stacks, Queues, Deques
A-Tech and Software Development
 
Data abstraction the walls
Data abstraction the wallsData abstraction the walls
Data abstraction the walls
Hoang Nguyen
 
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
ajay pashankar
 
Stack in Sata Structure
Stack in Sata StructureStack in Sata Structure
Stack in Sata Structure
Muhazzab Chouhadry
 
Data structure-questions
Data structure-questionsData structure-questions
Data structure-questions
Shekhar Chander
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna university
sangeethajames07
 
data structure
data structuredata structure
data structure
hashim102
 
deque and it applications
deque and it applicationsdeque and it applications
deque and it applications
Sathasivam Rangasamy
 

Viewers also liked (20)

Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
11 abstract data types
11 abstract data types11 abstract data types
11 abstract data types
 
Array linear data_structure_2 (1)
Array linear data_structure_2 (1)Array linear data_structure_2 (1)
Array linear data_structure_2 (1)
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Lec3
Lec3Lec3
Lec3
 
Chapter03
Chapter03Chapter03
Chapter03
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Stacks and queue
Stacks and queueStacks and queue
Stacks and queue
 
Stacks, Queues, Deques
Stacks, Queues, DequesStacks, Queues, Deques
Stacks, Queues, Deques
 
Data abstraction the walls
Data abstraction the wallsData abstraction the walls
Data abstraction the walls
 
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
 
Stack in Sata Structure
Stack in Sata StructureStack in Sata Structure
Stack in Sata Structure
 
Data structure-questions
Data structure-questionsData structure-questions
Data structure-questions
 
Data structures question paper anna university
Data structures question paper anna universityData structures question paper anna university
Data structures question paper anna university
 
data structure
data structuredata structure
data structure
 
deque and it applications
deque and it applicationsdeque and it applications
deque and it applications
 

Similar to Algo>Abstract data type

Chapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptChapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.ppt
NORSHADILAAHMADBADEL
 
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
AmrutaNavale2
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
line24arts
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
Rai University
 
AQA Computer science easter revision
AQA Computer science easter revisionAQA Computer science easter revision
AQA Computer science easter revision
Montgomery High School, Blackpool, UK
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
Rai University
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
Rai University
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Nimmi Weeraddana
 
Lect1.pptx
Lect1.pptxLect1.pptx
Bt0065
Bt0065Bt0065
Bt0065
Simpaly Jha
 
B T0065
B T0065B T0065
B T0065
Simpaly Jha
 
SULTHAN's - Data Structures
SULTHAN's - Data StructuresSULTHAN's - Data Structures
SULTHAN's - Data Structures
SULTHAN BASHA
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
MaryJacob24
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
Qundeel
 
Data Structure
Data StructureData Structure
Data Structure
sheraz1
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
Qundeel
 
Data structures using C
Data structures using CData structures using C
Data structures using C
Pdr Patnaik
 
Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02
Salman Qamar
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
SaheedTundeZubairSTA
 

Similar to Algo>Abstract data type (20)

Chapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.pptChapter 1 - Introduction to Data Structure.ppt
Chapter 1 - Introduction to Data Structure.ppt
 
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 
AQA Computer science easter revision
AQA Computer science easter revisionAQA Computer science easter revision
AQA Computer science easter revision
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
Lect1.pptx
Lect1.pptxLect1.pptx
Lect1.pptx
 
Bt0065
Bt0065Bt0065
Bt0065
 
B T0065
B T0065B T0065
B T0065
 
SULTHAN's - Data Structures
SULTHAN's - Data StructuresSULTHAN's - Data Structures
SULTHAN's - Data Structures
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Data Structure
Data StructureData Structure
Data Structure
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
 

More from Ain-ul-Moiz Khawaja

Algo>Queues
Algo>QueuesAlgo>Queues
Algo>Queues
Ain-ul-Moiz Khawaja
 
Application of Stacks
Application of StacksApplication of Stacks
Application of Stacks
Ain-ul-Moiz Khawaja
 
Algo>Stacks
Algo>StacksAlgo>Stacks
Algo>Stacks
Ain-ul-Moiz Khawaja
 
Analysis of Algorithum
Analysis of AlgorithumAnalysis of Algorithum
Analysis of Algorithum
Ain-ul-Moiz Khawaja
 
Algo>ADT list & linked list
Algo>ADT list & linked listAlgo>ADT list & linked list
Algo>ADT list & linked list
Ain-ul-Moiz Khawaja
 
Algo>Arrays
Algo>ArraysAlgo>Arrays
Algo>Arrays
Ain-ul-Moiz Khawaja
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
Ain-ul-Moiz Khawaja
 
Sorting algorithums > Data Structures & Algorithums
Sorting algorithums  > Data Structures & AlgorithumsSorting algorithums  > Data Structures & Algorithums
Sorting algorithums > Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
Sorting algos > Data Structures & Algorithums
Sorting algos  > Data Structures & AlgorithumsSorting algos  > Data Structures & Algorithums
Sorting algos > Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
Huffman > Data Structures & Algorithums
Huffman > Data Structures & AlgorithumsHuffman > Data Structures & Algorithums
Huffman > Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
Graphs > Discrete structures , Data Structures & Algorithums
Graphs > Discrete structures , Data Structures & AlgorithumsGraphs > Discrete structures , Data Structures & Algorithums
Graphs > Discrete structures , Data Structures & Algorithums
Ain-ul-Moiz Khawaja
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
Ain-ul-Moiz Khawaja
 
Turn over
Turn overTurn over
Attribution Theories
Attribution TheoriesAttribution Theories
Attribution Theories
Ain-ul-Moiz Khawaja
 
Attribution Theory
Attribution TheoryAttribution Theory
Attribution Theory
Ain-ul-Moiz Khawaja
 
Absenteeism
AbsenteeismAbsenteeism
Absenteeism
Ain-ul-Moiz Khawaja
 
HRM Employee Turnover
HRM Employee TurnoverHRM Employee Turnover
HRM Employee Turnover
Ain-ul-Moiz Khawaja
 

More from Ain-ul-Moiz Khawaja (17)

Algo>Queues
Algo>QueuesAlgo>Queues
Algo>Queues
 
Application of Stacks
Application of StacksApplication of Stacks
Application of Stacks
 
Algo>Stacks
Algo>StacksAlgo>Stacks
Algo>Stacks
 
Analysis of Algorithum
Analysis of AlgorithumAnalysis of Algorithum
Analysis of Algorithum
 
Algo>ADT list & linked list
Algo>ADT list & linked listAlgo>ADT list & linked list
Algo>ADT list & linked list
 
Algo>Arrays
Algo>ArraysAlgo>Arrays
Algo>Arrays
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
 
Sorting algorithums > Data Structures & Algorithums
Sorting algorithums  > Data Structures & AlgorithumsSorting algorithums  > Data Structures & Algorithums
Sorting algorithums > Data Structures & Algorithums
 
Sorting algos > Data Structures & Algorithums
Sorting algos  > Data Structures & AlgorithumsSorting algos  > Data Structures & Algorithums
Sorting algos > Data Structures & Algorithums
 
Huffman > Data Structures & Algorithums
Huffman > Data Structures & AlgorithumsHuffman > Data Structures & Algorithums
Huffman > Data Structures & Algorithums
 
Graphs > Discrete structures , Data Structures & Algorithums
Graphs > Discrete structures , Data Structures & AlgorithumsGraphs > Discrete structures , Data Structures & Algorithums
Graphs > Discrete structures , Data Structures & Algorithums
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Turn over
Turn overTurn over
Turn over
 
Attribution Theories
Attribution TheoriesAttribution Theories
Attribution Theories
 
Attribution Theory
Attribution TheoryAttribution Theory
Attribution Theory
 
Absenteeism
AbsenteeismAbsenteeism
Absenteeism
 
HRM Employee Turnover
HRM Employee TurnoverHRM Employee Turnover
HRM Employee Turnover
 

Recently uploaded

The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Leena Ghag-Sakpal
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 

Recently uploaded (20)

The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 

Algo>Abstract data type

  • 2. 2 Abstract Data Types Abstract Data Type (ADT): a definition for a data type solely in terms of a set of values and a set of operations on that data type. Each ADT operation is defined by its inputs and outputs. ENCAPSULATION: Hide Implementation details
  • 3. 3 Def. e.g. whole numbers (integers) and arithmetic operators for addition, subtraction, multiplication and division. e.g. Flight reservation Basic operations: find empty seat, reserve a seat, cancel a seat assignment Why "abstract?" Data, operations, and relations are studied independent of implementation. What not how is the focus. a collection of related data items together with an associated set of operations Abstract Data Types
  • 4. 4 Def. Consists of storage structures (data structures) to store the data items and algorithms for the basic operations. The storage structures/data structures used in implementations are provided in a language (primitive or built-in) or are built from the language constructs (user-defined). In either case, successful software design uses data abstraction: Separating the definition of a data type from its implementation. Abstract Data Types
  • 5. 5 Data Structure A data structure is the physical implementation of an ADT. Each operation associated with the ADT is implemented by one or more subroutines in the implementation. Data structure usually refers to an organization of data in main memory. File structure is an organization for data on peripheral storage, such as a disk drive.
  • 6. 6 Data Type ADT: Type Operations Data Items: Logical Form Data Items: Physical Form Data Structure: Storage Space Subroutines
  • 7. 7 Simple Data Types Memory: 2-state devices ↔ bits 0 and 1 Organized into bytes (8 bits) and words (machine dependent — e.g., 2 bytes). Each byte (or word) has an address making it possible to store and retrieve contents of any given memory location. Therefore: the most basic form of data: sequences of bits simple data types (values are atomic — can't be subdivided) are ADTs. Implementations have: » Storage structures: memory locations » Algorithms: system hardware/software to do basic operations.
  • 8. 8 Boolean data Data values: {false, true} In C/C++: false = 0, true = 1 (or nonzero) Operations: and && or || not ! x !x 0 1 1 0 && 0 1 0 0 0 1 0 1 | | 0 1 0 0 1 1 1 1
  • 9. 9 Character Data Store numeric codes (ASCII, EBCDIC, Unicode) 1 byte for ASCII and EBCDIC, 2 bytes for Unicode Basic operation: comparison to determine ifEqual, Less than ,Greater than, etc. use their numeric codes (i.e. use ordinal value) ASCII/EBCDIC Unicode
  • 10. 10 Integer Data Non-negative (unsigned) integer: Store its base-two representation in a fixed number w of bits (e.g., w = 16 or w = 32) 88 = 00000000010110002 Signed integer: Store in a fixed number w of bits using one of the following representations:
  • 11. 11 Sign-magnitude representation Save one bit (usually most significant) for sign (0 = +, 1 = – ) Use base-two representation in the other bits. 88 → _0000000010110000 ↑ sign bit Cumbersome for arithmetic computations –88 → _000000001011000 ↓ 1
  • 12. 12 Two's complement representation For negative n (–n): (1) Find w-bit base-2 representation of n (2) Complement each bit. (3) Add 1 Example: –88 1. 88 as a 16-bit base-two number 0000000001011000 Same as sign mag.For nonnegative n: Use ordinary base-two representation with leading (sign) bit 0 2. Complement this bit string 3. Add 1 1111111110100111 1111111110101000 (Flip all bits from rightmost 0 to the end)