SlideShare a Scribd company logo
 
Chapter 18 Standard Template Library Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Overview ,[object Object],[object Object],[object Object],Slide 18-
18.1 Iterators Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Iterators ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Using Declarations ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Iterator Basics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Basic Iterator Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
More Iterator Operations ,[object Object],[object Object],[object Object],[object Object],Slide 18-  Display 18.1
Kinds of Iterators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-  Display 18.2 (1-2)
Constant and Mutable Iterators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Reverse Iterators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-  Display 18.3 (1-2)
Other Kinds of Iterators ,[object Object],[object Object],[object Object],Slide 18-
18.2 Containers Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Containers  ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Sequential Containers ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-  Display 18.4 Display 18.5
Common Container Members ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
More Common Container Members ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
More Common Container Members ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
More Common Container Members ,[object Object],[object Object],[object Object],[object Object],Slide 18-
PITFALL :  Iterators and Removing Elements ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Operation Support Slide 18-  (X)  Indicates this operation is significantly slower. Display 18.6 Operation Function vector List deque Insert at front push_front(e) - X  X Insert at back push_back(e)  X X  X Delete at front pop_front( ) - X X Delete at back pop_back( ) X X X Insert in middle insert(e) (X) X (X) Delete in middle erase(iter )  (X) X (X) Sort sort( )  X - X
The Container Adapters  st ack  and  queue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Container Adapter  stack ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
stack   Member Functions Slide 18-  Display 18.10 (1-2) Sample Member Functions Member function Returns s.size( ) number of elements in stack s.empty( ) true if no elements in stack else false  s.top( ) reference to top stack member  s.push(elem) void Inserts copy of  elem  on stack top s.pop( ) void function. Removes top of stack. s1  = =  s2 true if sizes same and corresponding pairs of elements are equal, else false
Container Adapter  queue   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
queue  Member Functions Slide 18-  Sample Member Functions Member function Returns q.size( ) number of elements in queue q.empty( ) true if no elements in queue else false  q.front( ) reference to front queue member  q.push(elem) void adds a copy of  elem  at queue rear q.pop( ) void function. Removes front of queue. q1  = =  q2 true if sizes same and corresonding pairs of elements are equal, else false
Associative Containers set and map ,[object Object],[object Object],[object Object],[object Object],Slide 18-
The  set  Associative Container ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
set  Member Functions Slide 18-  Display 18.12 function Returns s.size( ) number of elements in set s.empty( ) true if no elements in set else false  s.insert(el) Insert  elem  in set. No effect if  el  is a member  s.erase(itr) Erase element to which  itr  refers  s.erase(el) Erase element  el  from set. No effect if  el  is not a member s.find(el) Mutable iterator to location of  el  in set if present, else returns s.end( ) s1  = =  s2 true if sizes same and corresponding pairs of elements are equal, else false
The  map  associative container ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Maps as associative arrays ,[object Object],[object Object],[object Object],Slide 18-  Display 18.14 (1-2)
map  Member Functions Slide 18-  Function Returns m.size( ) number of pairs in the map m.empty( ) true if no pairs are in the map else false  m.insert(el) el  is a pair <key, T> Inserts  el  into map. Returns <iterator, bool>. If successful, bool is true, iterator points to inserted pair. Otherwise bool is false m.erase(key) Erase element with key value  key  from map.  m.find(el) Mutable iterator to location of  el  in map if present, else returns m.end( ) m1  = =  m2 true if maps contain the same pairs, else false m[target] Returns a reference to the map object associated to a key of target.
Efficiency ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
18.3 Generic Algorithms Copyright © 2008 Pearson Addison-Wesley.  All rights reserved.
Generic Algorithms  ,[object Object],[object Object],[object Object],Slide 18-
Running Times and Big-O Notation ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Worst case running time ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
An example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Objections ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Big-O Notation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Large Coefficients Do Not Matter ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Some generic terminology ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-  Display 18.16
Container Access Time 1 ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Container Access Time 2 ,[object Object],[object Object],[object Object],Slide 18-
Generic Algorithm Classification ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Nonmodifying Sequence Algorithms ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Iter find(Iter first, Iter last,   const T& value); ,[object Object],[object Object],[object Object],[object Object],Slide 18-
More nonmodifying Algorithms ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Container Modifying Algorithms ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Sorting Algorithms ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Chapter Summary 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Chapter Summary 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Chapter Summary 3 ,[object Object],[object Object],[object Object],[object Object],Slide 18-
Chapter Summary 4 ,[object Object],[object Object],[object Object],[object Object],[object Object],Slide 18-
Chapter Summary 5 ,[object Object],[object Object],[object Object],Slide 18-
Chapter 18 -- End Slide 18-
Display 18.1 Slide 17-  Back Next
Display 18.2 (1/2) Slide 17-  Back Next
Display 18.2 (2/2) Slide 17-  Back Next
Display 18.3 (1/2) Slide 17-  Back Next
Display 18.3 (2/2) Slide 17-  Back Next
Display 18.4 Slide 17-  Back Next
Display 18.5 Slide 17-  Back Next
Display 18.6 Slide 17-  Back Next
Display 18.10 (1/2) Slide 17-  Back Next
Display 18.10 (2/2) Slide 17-  Back Next
Display 18.12 Slide 17-  Back Next
Display 18.14 (1/2) Slide 17-  Back Next
Display 18.14 (2/2) Slide 17-  Back Next
Display 18.16 Slide 17-  Back Next

More Related Content

What's hot

STORAGE CLASSES
STORAGE CLASSESSTORAGE CLASSES
STORAGE CLASSES
sathish sak
 
Review of c_sharp2_features_part_iii
Review of c_sharp2_features_part_iiiReview of c_sharp2_features_part_iii
Review of c_sharp2_features_part_iii
Nico Ludwig
 
Regular types in C++
Regular types in C++Regular types in C++
Regular types in C++
Ilio Catallo
 
Storage class
Storage classStorage class
Storage class
Joy Forerver
 
Manipulators
ManipulatorsManipulators
Manipulators
VaishnaviVaishnavi17
 
Talk on Standard Template Library
Talk on Standard Template LibraryTalk on Standard Template Library
Talk on Standard Template Library
Anirudh Raja
 
11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage classkapil078
 
Stack and its operations
Stack and its operationsStack and its operations
Stack and its operations
V.V.Vanniaperumal College for Women
 
Storage classes in C
Storage classes in C Storage classes in C
Storage classes in C
Self employed
 
List in java
List in javaList in java
List in java
nitin kumar
 
C++tutorial
C++tutorialC++tutorial
C++tutorialdips17
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17ecomputernotes
 
Smart Pointers in C++
Smart Pointers in C++Smart Pointers in C++
Smart Pointers in C++
Francesco Casalegno
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detection
Võ Hòa
 
C++11
C++11C++11
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 Features
Jan Rüegg
 
storage class
storage classstorage class
storage classstudent
 
JavaScript ES10 and React Js Introduction
JavaScript ES10 and React Js IntroductionJavaScript ES10 and React Js Introduction
JavaScript ES10 and React Js Introduction
Amanpreet Singh
 

What's hot (20)

STORAGE CLASSES
STORAGE CLASSESSTORAGE CLASSES
STORAGE CLASSES
 
Review of c_sharp2_features_part_iii
Review of c_sharp2_features_part_iiiReview of c_sharp2_features_part_iii
Review of c_sharp2_features_part_iii
 
Regular types in C++
Regular types in C++Regular types in C++
Regular types in C++
 
Storage class
Storage classStorage class
Storage class
 
강의자료8
강의자료8강의자료8
강의자료8
 
Manipulators
ManipulatorsManipulators
Manipulators
 
Talk on Standard Template Library
Talk on Standard Template LibraryTalk on Standard Template Library
Talk on Standard Template Library
 
11 lec 11 storage class
11 lec 11 storage class11 lec 11 storage class
11 lec 11 storage class
 
Stack and its operations
Stack and its operationsStack and its operations
Stack and its operations
 
Storage classes in C
Storage classes in C Storage classes in C
Storage classes in C
 
Storage classes
Storage classesStorage classes
Storage classes
 
List in java
List in javaList in java
List in java
 
C++tutorial
C++tutorialC++tutorial
C++tutorial
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
 
Smart Pointers in C++
Smart Pointers in C++Smart Pointers in C++
Smart Pointers in C++
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detection
 
C++11
C++11C++11
C++11
 
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 Features
 
storage class
storage classstorage class
storage class
 
JavaScript ES10 and React Js Introduction
JavaScript ES10 and React Js IntroductionJavaScript ES10 and React Js Introduction
JavaScript ES10 and React Js Introduction
 

Viewers also liked

Savitch Ch 06
Savitch Ch 06Savitch Ch 06
Savitch Ch 06
Terry Yoast
 
Savitch c++ ppt figs ch1
Savitch c++ ppt figs ch1Savitch c++ ppt figs ch1
Savitch c++ ppt figs ch1Terry Yoast
 
Savitch Ch 04
Savitch Ch 04Savitch Ch 04
Savitch Ch 04
Terry Yoast
 
Savitch Ch 05
Savitch Ch 05Savitch Ch 05
Savitch Ch 05
Terry Yoast
 

Viewers also liked (20)

Savitch Ch 03
Savitch Ch 03Savitch Ch 03
Savitch Ch 03
 
Savitch Ch 15
Savitch Ch 15Savitch Ch 15
Savitch Ch 15
 
Savitch Ch 02
Savitch Ch 02Savitch Ch 02
Savitch Ch 02
 
Savitch Ch 17
Savitch Ch 17Savitch Ch 17
Savitch Ch 17
 
Savitch Ch 08
Savitch Ch 08Savitch Ch 08
Savitch Ch 08
 
Savitch Ch 13
Savitch Ch 13Savitch Ch 13
Savitch Ch 13
 
Savitch Ch 11
Savitch Ch 11Savitch Ch 11
Savitch Ch 11
 
Savitch Ch 01
Savitch Ch 01Savitch Ch 01
Savitch Ch 01
 
Savitch Ch 06
Savitch Ch 06Savitch Ch 06
Savitch Ch 06
 
Savitch ch 022
Savitch ch 022Savitch ch 022
Savitch ch 022
 
Savitch c++ ppt figs ch1
Savitch c++ ppt figs ch1Savitch c++ ppt figs ch1
Savitch c++ ppt figs ch1
 
Savitch Ch 07
Savitch Ch 07Savitch Ch 07
Savitch Ch 07
 
Savitch Ch 14
Savitch Ch 14Savitch Ch 14
Savitch Ch 14
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
Savitch Ch 12
Savitch Ch 12Savitch Ch 12
Savitch Ch 12
 
Savitch Ch 10
Savitch Ch 10Savitch Ch 10
Savitch Ch 10
 
Savitch ch 04
Savitch ch 04Savitch ch 04
Savitch ch 04
 
Savitch ch 16
Savitch ch 16Savitch ch 16
Savitch ch 16
 
Savitch Ch 04
Savitch Ch 04Savitch Ch 04
Savitch Ch 04
 
Savitch Ch 05
Savitch Ch 05Savitch Ch 05
Savitch Ch 05
 

Similar to Savitch Ch 18

Stl Containers
Stl ContainersStl Containers
Stl Containers
ppd1961
 
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
RAtna29
 
Create a Queue class that implements a queue abstraction. A queue is.docx
Create a Queue class that implements a queue abstraction. A queue is.docxCreate a Queue class that implements a queue abstraction. A queue is.docx
Create a Queue class that implements a queue abstraction. A queue is.docx
rajahchelsey
 
Create a Dynamic Array container with this user interface Ge.pdf
Create a Dynamic Array container with this user interface  Ge.pdfCreate a Dynamic Array container with this user interface  Ge.pdf
Create a Dynamic Array container with this user interface Ge.pdf
sktambifortune
 
Please the following is the currency class of perious one- class Curre.pdf
Please the following is the currency class of perious one- class Curre.pdfPlease the following is the currency class of perious one- class Curre.pdf
Please the following is the currency class of perious one- class Curre.pdf
admin463580
 
Please solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docxPlease solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docx
PeterlqELawrenceb
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docx
shericehewat
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docx
Isaac9LjWelchq
 
STL in C++
STL in C++STL in C++
STL in C++
Surya Prakash Sahu
 
I really need help with my C++ assignment. The following is the info.pdf
I really need help with my C++ assignment. The following is the info.pdfI really need help with my C++ assignment. The following is the info.pdf
I really need help with my C++ assignment. The following is the info.pdf
wasemanivytreenrco51
 
Lecture11 standard template-library
Lecture11 standard template-libraryLecture11 standard template-library
Lecture11 standard template-libraryHariz Mustafa
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interview
Russell Childs
 
Memory Management In C++
Memory Management In C++Memory Management In C++
Memory Management In C++
ShriKant Vashishtha
 
computer notes - Reference variables ii
computer notes - Reference variables iicomputer notes - Reference variables ii
computer notes - Reference variables ii
ecomputernotes
 
The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202
Mahmoud Samir Fayed
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
Abhishek Tirkey
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
GauravPandey43518
 
Data structures
Data structuresData structures
Data structures
naveeth babu
 

Similar to Savitch Ch 18 (20)

Stl Containers
Stl ContainersStl Containers
Stl Containers
 
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
 
Create a Queue class that implements a queue abstraction. A queue is.docx
Create a Queue class that implements a queue abstraction. A queue is.docxCreate a Queue class that implements a queue abstraction. A queue is.docx
Create a Queue class that implements a queue abstraction. A queue is.docx
 
Create a Dynamic Array container with this user interface Ge.pdf
Create a Dynamic Array container with this user interface  Ge.pdfCreate a Dynamic Array container with this user interface  Ge.pdf
Create a Dynamic Array container with this user interface Ge.pdf
 
Please the following is the currency class of perious one- class Curre.pdf
Please the following is the currency class of perious one- class Curre.pdfPlease the following is the currency class of perious one- class Curre.pdf
Please the following is the currency class of perious one- class Curre.pdf
 
C chap22
C chap22C chap22
C chap22
 
Please solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docxPlease solve the following problem using C++- Thank you Instructions-.docx
Please solve the following problem using C++- Thank you Instructions-.docx
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docx
 
hello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docxhello- please dont just copy from other answers- the following is the.docx
hello- please dont just copy from other answers- the following is the.docx
 
STL in C++
STL in C++STL in C++
STL in C++
 
I really need help with my C++ assignment. The following is the info.pdf
I really need help with my C++ assignment. The following is the info.pdfI really need help with my C++ assignment. The following is the info.pdf
I really need help with my C++ assignment. The following is the info.pdf
 
Lecture11 standard template-library
Lecture11 standard template-libraryLecture11 standard template-library
Lecture11 standard template-library
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interview
 
Constructor,destructors cpp
Constructor,destructors cppConstructor,destructors cpp
Constructor,destructors cpp
 
Memory Management In C++
Memory Management In C++Memory Management In C++
Memory Management In C++
 
computer notes - Reference variables ii
computer notes - Reference variables iicomputer notes - Reference variables ii
computer notes - Reference variables ii
 
The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
Data structures
Data structuresData structures
Data structures
 

More from Terry Yoast

9781305078444 ppt ch12
9781305078444 ppt ch129781305078444 ppt ch12
9781305078444 ppt ch12
Terry Yoast
 
9781305078444 ppt ch11
9781305078444 ppt ch119781305078444 ppt ch11
9781305078444 ppt ch11
Terry Yoast
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
Terry Yoast
 
9781305078444 ppt ch09
9781305078444 ppt ch099781305078444 ppt ch09
9781305078444 ppt ch09
Terry Yoast
 
9781305078444 ppt ch08
9781305078444 ppt ch089781305078444 ppt ch08
9781305078444 ppt ch08
Terry Yoast
 
9781305078444 ppt ch07
9781305078444 ppt ch079781305078444 ppt ch07
9781305078444 ppt ch07
Terry Yoast
 
9781305078444 ppt ch06
9781305078444 ppt ch069781305078444 ppt ch06
9781305078444 ppt ch06
Terry Yoast
 
9781305078444 ppt ch05
9781305078444 ppt ch059781305078444 ppt ch05
9781305078444 ppt ch05
Terry Yoast
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04
Terry Yoast
 
9781305078444 ppt ch03
9781305078444 ppt ch039781305078444 ppt ch03
9781305078444 ppt ch03
Terry Yoast
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02
Terry Yoast
 
9781305078444 ppt ch01
9781305078444 ppt ch019781305078444 ppt ch01
9781305078444 ppt ch01
Terry Yoast
 
9781337102087 ppt ch13
9781337102087 ppt ch139781337102087 ppt ch13
9781337102087 ppt ch13
Terry Yoast
 
9781337102087 ppt ch18
9781337102087 ppt ch189781337102087 ppt ch18
9781337102087 ppt ch18
Terry Yoast
 
9781337102087 ppt ch17
9781337102087 ppt ch179781337102087 ppt ch17
9781337102087 ppt ch17
Terry Yoast
 
9781337102087 ppt ch16
9781337102087 ppt ch169781337102087 ppt ch16
9781337102087 ppt ch16
Terry Yoast
 
9781337102087 ppt ch15
9781337102087 ppt ch159781337102087 ppt ch15
9781337102087 ppt ch15
Terry Yoast
 
9781337102087 ppt ch14
9781337102087 ppt ch149781337102087 ppt ch14
9781337102087 ppt ch14
Terry Yoast
 
9781337102087 ppt ch12
9781337102087 ppt ch129781337102087 ppt ch12
9781337102087 ppt ch12
Terry Yoast
 
9781337102087 ppt ch11
9781337102087 ppt ch119781337102087 ppt ch11
9781337102087 ppt ch11
Terry Yoast
 

More from Terry Yoast (20)

9781305078444 ppt ch12
9781305078444 ppt ch129781305078444 ppt ch12
9781305078444 ppt ch12
 
9781305078444 ppt ch11
9781305078444 ppt ch119781305078444 ppt ch11
9781305078444 ppt ch11
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
 
9781305078444 ppt ch09
9781305078444 ppt ch099781305078444 ppt ch09
9781305078444 ppt ch09
 
9781305078444 ppt ch08
9781305078444 ppt ch089781305078444 ppt ch08
9781305078444 ppt ch08
 
9781305078444 ppt ch07
9781305078444 ppt ch079781305078444 ppt ch07
9781305078444 ppt ch07
 
9781305078444 ppt ch06
9781305078444 ppt ch069781305078444 ppt ch06
9781305078444 ppt ch06
 
9781305078444 ppt ch05
9781305078444 ppt ch059781305078444 ppt ch05
9781305078444 ppt ch05
 
9781305078444 ppt ch04
9781305078444 ppt ch049781305078444 ppt ch04
9781305078444 ppt ch04
 
9781305078444 ppt ch03
9781305078444 ppt ch039781305078444 ppt ch03
9781305078444 ppt ch03
 
9781305078444 ppt ch02
9781305078444 ppt ch029781305078444 ppt ch02
9781305078444 ppt ch02
 
9781305078444 ppt ch01
9781305078444 ppt ch019781305078444 ppt ch01
9781305078444 ppt ch01
 
9781337102087 ppt ch13
9781337102087 ppt ch139781337102087 ppt ch13
9781337102087 ppt ch13
 
9781337102087 ppt ch18
9781337102087 ppt ch189781337102087 ppt ch18
9781337102087 ppt ch18
 
9781337102087 ppt ch17
9781337102087 ppt ch179781337102087 ppt ch17
9781337102087 ppt ch17
 
9781337102087 ppt ch16
9781337102087 ppt ch169781337102087 ppt ch16
9781337102087 ppt ch16
 
9781337102087 ppt ch15
9781337102087 ppt ch159781337102087 ppt ch15
9781337102087 ppt ch15
 
9781337102087 ppt ch14
9781337102087 ppt ch149781337102087 ppt ch14
9781337102087 ppt ch14
 
9781337102087 ppt ch12
9781337102087 ppt ch129781337102087 ppt ch12
9781337102087 ppt ch12
 
9781337102087 ppt ch11
9781337102087 ppt ch119781337102087 ppt ch11
9781337102087 ppt ch11
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
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
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
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
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 

Savitch Ch 18

  • 1.  
  • 2. Chapter 18 Standard Template Library Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
  • 3.
  • 4. 18.1 Iterators Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. 18.2 Containers Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Operation Support Slide 18- (X) Indicates this operation is significantly slower. Display 18.6 Operation Function vector List deque Insert at front push_front(e) - X X Insert at back push_back(e) X X X Delete at front pop_front( ) - X X Delete at back pop_back( ) X X X Insert in middle insert(e) (X) X (X) Delete in middle erase(iter ) (X) X (X) Sort sort( ) X - X
  • 23.
  • 24.
  • 25. stack Member Functions Slide 18- Display 18.10 (1-2) Sample Member Functions Member function Returns s.size( ) number of elements in stack s.empty( ) true if no elements in stack else false s.top( ) reference to top stack member s.push(elem) void Inserts copy of elem on stack top s.pop( ) void function. Removes top of stack. s1 = = s2 true if sizes same and corresponding pairs of elements are equal, else false
  • 26.
  • 27. queue Member Functions Slide 18- Sample Member Functions Member function Returns q.size( ) number of elements in queue q.empty( ) true if no elements in queue else false q.front( ) reference to front queue member q.push(elem) void adds a copy of elem at queue rear q.pop( ) void function. Removes front of queue. q1 = = q2 true if sizes same and corresonding pairs of elements are equal, else false
  • 28.
  • 29.
  • 30. set Member Functions Slide 18- Display 18.12 function Returns s.size( ) number of elements in set s.empty( ) true if no elements in set else false s.insert(el) Insert elem in set. No effect if el is a member s.erase(itr) Erase element to which itr refers s.erase(el) Erase element el from set. No effect if el is not a member s.find(el) Mutable iterator to location of el in set if present, else returns s.end( ) s1 = = s2 true if sizes same and corresponding pairs of elements are equal, else false
  • 31.
  • 32.
  • 33. map Member Functions Slide 18- Function Returns m.size( ) number of pairs in the map m.empty( ) true if no pairs are in the map else false m.insert(el) el is a pair <key, T> Inserts el into map. Returns <iterator, bool>. If successful, bool is true, iterator points to inserted pair. Otherwise bool is false m.erase(key) Erase element with key value key from map. m.find(el) Mutable iterator to location of el in map if present, else returns m.end( ) m1 = = m2 true if maps contain the same pairs, else false m[target] Returns a reference to the map object associated to a key of target.
  • 34.
  • 35. 18.3 Generic Algorithms Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. Chapter 18 -- End Slide 18-
  • 58. Display 18.1 Slide 17- Back Next
  • 59. Display 18.2 (1/2) Slide 17- Back Next
  • 60. Display 18.2 (2/2) Slide 17- Back Next
  • 61. Display 18.3 (1/2) Slide 17- Back Next
  • 62. Display 18.3 (2/2) Slide 17- Back Next
  • 63. Display 18.4 Slide 17- Back Next
  • 64. Display 18.5 Slide 17- Back Next
  • 65. Display 18.6 Slide 17- Back Next
  • 66. Display 18.10 (1/2) Slide 17- Back Next
  • 67. Display 18.10 (2/2) Slide 17- Back Next
  • 68. Display 18.12 Slide 17- Back Next
  • 69. Display 18.14 (1/2) Slide 17- Back Next
  • 70. Display 18.14 (2/2) Slide 17- Back Next
  • 71. Display 18.16 Slide 17- Back Next