SlideShare a Scribd company logo
1 of 12
TECH
Computer Science
Data Abstraction and Basic Data Structures
• Improving efficiency by building better
 Data Structure
• Object IN
 Abstract Data Type
 Specification
 Design
 Architecture [Structure, Function]
• Abstract Data Types
 Lists, Trees
 Stacks, Queues
 Priority Queue, Union-Find
 Dictionary
Abstract Data type
i is an instance of type T, i ∈ T
e is an element of set S, e ∈ S
o is an object of class C, o ∈ C
• Abstract Data Type
Structures: data structure declarations
Functions: operation definitions
• An ADT is identified as a Class
in languages such as C++ and Java
• Designing algorithms and
proving correctness of algorithms
based on ADT operations and specifications
ADT Specification
• The specification of an ADT describe how the operations
(functions, procedures, or methods) behave
 in terms of Inputs and Outputs
• A specification of an operation consists of:
 Calling prototype
 Preconditions
 Postconditions
• The calling prototype includes
 name of the operation
 parameters and their types
 return value and its types
• The preconditions are statements
 assumed to be true when the operation is called.
• The postconditions are statements
 assumed to be true when the operation returns.
Operations for ADT
• Constructors
create a new object and return a reference to it
• Access functions
return information about an object, but do not modify it
• Manipulation procedures
modify an object, but do not return information
• State of an object
current values of its data
• Describing constructors and manipulation procedures
in terms of Access functions
• Recursive ADT
if any of its access functions returns
the same class as the ADT
ADT Design e.g. Lists
Every computable function can be computed using
Lists as the only data structure!
• IntList cons(int newElement, IntList oldList)
Precondition: None.
Postconditions: If x = cons(newElement, oldList) then
1. x refers to a newly created object;
2. x != nil;
3. first(x) = newElement;
4. rest(x) = oldList
• int first(IntList aList) // access function
Precondition: aList != nil
• IntList rest(IntList aList) // access function
Precondition: aList != nil
• IntList nil //constant denoting the empty list.
Binary Tree
• A binary tree T is a set of elements, called nodes,
that is empty or satisfies:
1. There is a distinguished node r called the root
2. The remaining nodes are divided into two disjoint
subsets, L and R, each of which is a binary tree.
L is called the left subtree of T and R is called the right
subtree of T.
• There are at most 2d
nodes at depth d of a binary tree.
• A binary tree with n nodes has height at least
Ceiling[lg(n+1)] – 1.
• A binary tree with height h has at most 2h+1
–1 nodes
Stacks
• A stack is a linear structure in which insertions and
deletions are always make at one end, called the top.
• This updating policy is call last in, first out (LIFO)
Queue
• A queue is a linear structure in which
all insertions are done at one end, called the rear or
back, and
all deletions are done at the other end, called the front.
• This updating policy is called first in, first out (FIFO)
Priority Queue
• A priority queue is a structure with some aspects of
FIFO queue but
in which element order is related to each element’s
priority,
rather than its chronological arrival time.
• As each element is inserted into a priority queue,
conceptually it is inserted in order of its priority
• The one element that can be inspected and removed is
the most important element currently in the priority
queue.
a cost viewpoint: the smallest priority
a profit viewpoint: the largest priority
Union-Find ADT for Disjoint Sets
• Through a Union operation, two (disjoint) sets can be
combined.
(to insure the disjoint property of all existing sets, the
original two sets are removed and the new set is added)
Let the set id of the original two set be, s and t, s != t
Then, new set has one unique set id that is either s or t.
• Through a Find operation, the current set id of an
element can be retrieved.
• Often elements are integers and
the set id is some particular element in the set,
called the leader, as in the next e.g.
Union-Find ADT e.g.
• UnionFind create(int n)
// create a set (called sets) of n singleton disjoint sets
{{1},{2},{3},…,{n}}
• int find(UnionFind sets, e)
// return the set id for e
• void makeSet(unionFind sets, int e)
//union one singleton set {e} (e not already in the sets)
into the exiting sets
• void union(UnionFind sets, int s, int t)
// s and t are set ids, s != t
// a new set is created by union of set [s] and set [t]
// the new set id is either s or t, in some case min(s, t)
Dictionary ADT
• A dictionary is a general associative storage structure.
• Items in a dictionary
have an identifier, and
associated information that needs to be stored and
retrieved.
no order implied for identifiers in a dictionary ADT

More Related Content

What's hot

Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsAakash deep Singhal
 
Arrays and structures
Arrays and structuresArrays and structures
Arrays and structuresMohd Arif
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1Aahwini Esware gowda
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its typesNavtar Sidhu Brar
 
Data Structure and Algorithms Arrays
Data Structure and Algorithms ArraysData Structure and Algorithms Arrays
Data Structure and Algorithms ArraysManishPrajapati78
 
Data structure and algorithm All in One
Data structure and algorithm All in OneData structure and algorithm All in One
Data structure and algorithm All in Onejehan1987
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array pptsandhya yadav
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.Education Front
 
Elementary data structure
Elementary data structureElementary data structure
Elementary data structureBiswajit Mandal
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structuresNiraj Agarwal
 
A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)Imdadul Himu
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structurestudent
 
Understanding the components of standard template library
Understanding the components of standard template libraryUnderstanding the components of standard template library
Understanding the components of standard template libraryRahul Sharma
 

What's hot (20)

Array ppt
Array pptArray ppt
Array ppt
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithms
 
Arrays and structures
Arrays and structuresArrays and structures
Arrays and structures
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Data Structure and Algorithms Arrays
Data Structure and Algorithms ArraysData Structure and Algorithms Arrays
Data Structure and Algorithms Arrays
 
Data Structures (BE)
Data Structures (BE)Data Structures (BE)
Data Structures (BE)
 
Data structure and algorithm All in One
Data structure and algorithm All in OneData structure and algorithm All in One
Data structure and algorithm All in One
 
ARRAY
ARRAYARRAY
ARRAY
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 
Elementary data structure
Elementary data structureElementary data structure
Elementary data structure
 
Fundamentals of data structures
Fundamentals of data structuresFundamentals of data structures
Fundamentals of data structures
 
Lecture 2a arrays
Lecture 2a arraysLecture 2a arrays
Lecture 2a arrays
 
A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structure
 
Understanding the components of standard template library
Understanding the components of standard template libraryUnderstanding the components of standard template library
Understanding the components of standard template library
 
Array in c++
Array in c++Array in c++
Array in c++
 
Data structures
Data structuresData structures
Data structures
 

Viewers also liked

Mansfield U3A Newsletter: September 2013
Mansfield U3A Newsletter: September 2013Mansfield U3A Newsletter: September 2013
Mansfield U3A Newsletter: September 2013dlpruk
 
DNA Lecture Notes
DNA Lecture NotesDNA Lecture Notes
DNA Lecture Notesdlpruk
 
Mansfield U3A Newsletter - March 2014
Mansfield U3A Newsletter - March 2014Mansfield U3A Newsletter - March 2014
Mansfield U3A Newsletter - March 2014dlpruk
 
Mansfield U3A Newsletter: January 2013
Mansfield U3A Newsletter: January 2013Mansfield U3A Newsletter: January 2013
Mansfield U3A Newsletter: January 2013dlpruk
 
Mansfield U3A - Poetry and Prose
Mansfield U3A - Poetry and ProseMansfield U3A - Poetry and Prose
Mansfield U3A - Poetry and Prosedlpruk
 
Ideest teostuseni ja TAF Regiost kaardikirjastuseni
Ideest teostuseni ja TAF Regiost kaardikirjastuseniIdeest teostuseni ja TAF Regiost kaardikirjastuseni
Ideest teostuseni ja TAF Regiost kaardikirjastuseniTiit Lepik
 
Tehnoloogia muutumised
Tehnoloogia muutumisedTehnoloogia muutumised
Tehnoloogia muutumisedTiit Lepik
 

Viewers also liked (7)

Mansfield U3A Newsletter: September 2013
Mansfield U3A Newsletter: September 2013Mansfield U3A Newsletter: September 2013
Mansfield U3A Newsletter: September 2013
 
DNA Lecture Notes
DNA Lecture NotesDNA Lecture Notes
DNA Lecture Notes
 
Mansfield U3A Newsletter - March 2014
Mansfield U3A Newsletter - March 2014Mansfield U3A Newsletter - March 2014
Mansfield U3A Newsletter - March 2014
 
Mansfield U3A Newsletter: January 2013
Mansfield U3A Newsletter: January 2013Mansfield U3A Newsletter: January 2013
Mansfield U3A Newsletter: January 2013
 
Mansfield U3A - Poetry and Prose
Mansfield U3A - Poetry and ProseMansfield U3A - Poetry and Prose
Mansfield U3A - Poetry and Prose
 
Ideest teostuseni ja TAF Regiost kaardikirjastuseni
Ideest teostuseni ja TAF Regiost kaardikirjastuseniIdeest teostuseni ja TAF Regiost kaardikirjastuseni
Ideest teostuseni ja TAF Regiost kaardikirjastuseni
 
Tehnoloogia muutumised
Tehnoloogia muutumisedTehnoloogia muutumised
Tehnoloogia muutumised
 

Similar to Ch02

Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02Getachew Ganfur
 
Data structures and Algorithm analysis_Lecture4.pptx
Data structures and Algorithm analysis_Lecture4.pptxData structures and Algorithm analysis_Lecture4.pptx
Data structures and Algorithm analysis_Lecture4.pptxAhmedEldesoky24
 
Funddamentals of data structures
Funddamentals of data structuresFunddamentals of data structures
Funddamentals of data structuresGlobalidiots
 
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1blessyboban92
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++•sreejith •sree
 
Revision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.docRevision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.docSrikrishnaVundavalli
 
Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...nsitlokeshjain
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structurekalyanineve
 
datastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptxdatastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptxDEEPAK948083
 
DATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTDATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTSwapnil Mishra
 

Similar to Ch02 (20)

Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02
 
Chapter 5 ds
Chapter 5 dsChapter 5 ds
Chapter 5 ds
 
Data structures and Algorithm analysis_Lecture4.pptx
Data structures and Algorithm analysis_Lecture4.pptxData structures and Algorithm analysis_Lecture4.pptx
Data structures and Algorithm analysis_Lecture4.pptx
 
Funddamentals of data structures
Funddamentals of data structuresFunddamentals of data structures
Funddamentals of data structures
 
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
 
Revision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.docRevision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.doc
 
Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...Basic of array and data structure, data structure basics, array, address calc...
Basic of array and data structure, data structure basics, array, address calc...
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
F sharp lists & dictionary
F sharp   lists &  dictionaryF sharp   lists &  dictionary
F sharp lists & dictionary
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 
C++ STL 概觀
C++ STL 概觀C++ STL 概觀
C++ STL 概觀
 
datastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptxdatastructureppt-190327174340 (1).pptx
datastructureppt-190327174340 (1).pptx
 
DATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGESTDATA STRUCTURES USING C -ENGGDIGEST
DATA STRUCTURES USING C -ENGGDIGEST
 
Unit i(dsc++)
Unit i(dsc++)Unit i(dsc++)
Unit i(dsc++)
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Data structures
Data structuresData structures
Data structures
 
9780324782011_PPT_ch09.ppt
9780324782011_PPT_ch09.ppt9780324782011_PPT_ch09.ppt
9780324782011_PPT_ch09.ppt
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Ch02

  • 1. TECH Computer Science Data Abstraction and Basic Data Structures • Improving efficiency by building better  Data Structure • Object IN  Abstract Data Type  Specification  Design  Architecture [Structure, Function] • Abstract Data Types  Lists, Trees  Stacks, Queues  Priority Queue, Union-Find  Dictionary
  • 2. Abstract Data type i is an instance of type T, i ∈ T e is an element of set S, e ∈ S o is an object of class C, o ∈ C • Abstract Data Type Structures: data structure declarations Functions: operation definitions • An ADT is identified as a Class in languages such as C++ and Java • Designing algorithms and proving correctness of algorithms based on ADT operations and specifications
  • 3. ADT Specification • The specification of an ADT describe how the operations (functions, procedures, or methods) behave  in terms of Inputs and Outputs • A specification of an operation consists of:  Calling prototype  Preconditions  Postconditions • The calling prototype includes  name of the operation  parameters and their types  return value and its types • The preconditions are statements  assumed to be true when the operation is called. • The postconditions are statements  assumed to be true when the operation returns.
  • 4. Operations for ADT • Constructors create a new object and return a reference to it • Access functions return information about an object, but do not modify it • Manipulation procedures modify an object, but do not return information • State of an object current values of its data • Describing constructors and manipulation procedures in terms of Access functions • Recursive ADT if any of its access functions returns the same class as the ADT
  • 5. ADT Design e.g. Lists Every computable function can be computed using Lists as the only data structure! • IntList cons(int newElement, IntList oldList) Precondition: None. Postconditions: If x = cons(newElement, oldList) then 1. x refers to a newly created object; 2. x != nil; 3. first(x) = newElement; 4. rest(x) = oldList • int first(IntList aList) // access function Precondition: aList != nil • IntList rest(IntList aList) // access function Precondition: aList != nil • IntList nil //constant denoting the empty list.
  • 6. Binary Tree • A binary tree T is a set of elements, called nodes, that is empty or satisfies: 1. There is a distinguished node r called the root 2. The remaining nodes are divided into two disjoint subsets, L and R, each of which is a binary tree. L is called the left subtree of T and R is called the right subtree of T. • There are at most 2d nodes at depth d of a binary tree. • A binary tree with n nodes has height at least Ceiling[lg(n+1)] – 1. • A binary tree with height h has at most 2h+1 –1 nodes
  • 7. Stacks • A stack is a linear structure in which insertions and deletions are always make at one end, called the top. • This updating policy is call last in, first out (LIFO)
  • 8. Queue • A queue is a linear structure in which all insertions are done at one end, called the rear or back, and all deletions are done at the other end, called the front. • This updating policy is called first in, first out (FIFO)
  • 9. Priority Queue • A priority queue is a structure with some aspects of FIFO queue but in which element order is related to each element’s priority, rather than its chronological arrival time. • As each element is inserted into a priority queue, conceptually it is inserted in order of its priority • The one element that can be inspected and removed is the most important element currently in the priority queue. a cost viewpoint: the smallest priority a profit viewpoint: the largest priority
  • 10. Union-Find ADT for Disjoint Sets • Through a Union operation, two (disjoint) sets can be combined. (to insure the disjoint property of all existing sets, the original two sets are removed and the new set is added) Let the set id of the original two set be, s and t, s != t Then, new set has one unique set id that is either s or t. • Through a Find operation, the current set id of an element can be retrieved. • Often elements are integers and the set id is some particular element in the set, called the leader, as in the next e.g.
  • 11. Union-Find ADT e.g. • UnionFind create(int n) // create a set (called sets) of n singleton disjoint sets {{1},{2},{3},…,{n}} • int find(UnionFind sets, e) // return the set id for e • void makeSet(unionFind sets, int e) //union one singleton set {e} (e not already in the sets) into the exiting sets • void union(UnionFind sets, int s, int t) // s and t are set ids, s != t // a new set is created by union of set [s] and set [t] // the new set id is either s or t, in some case min(s, t)
  • 12. Dictionary ADT • A dictionary is a general associative storage structure. • Items in a dictionary have an identifier, and associated information that needs to be stored and retrieved. no order implied for identifiers in a dictionary ADT