SlideShare a Scribd company logo
Standard Template Library:
Chapter 15:
Ms. Munazza Mah Jabeen
Assistant Professor of Computer Science
Introduction to the STL:
The STL contains several kinds of entities. The three most
important are containers, algorithms, and iterators.
• A container is a way that stored data is organized in
memory. E.g. stacks, linked lists, array etc.
• Sequence - vector, list, and deque uses keys
• Associative - set, multiset, map, multi-map uses tree and
key –value pair to access the values
• Derived Sequence Containers - stack, queue, and priority
queue
• Algorithms in the STL are procedures that are applied to
containers to process their data in various ways e.g.
sort, copy, search and merge data.
• Iterators are a generalization of the concept of
pointers: they point to elements in a container.
Member Functions:
Algorithms:
Algorithms Examples:
Iterators:
• Iterators are pointer-like entities that are used to
access individual data items called elements.
• They are used to move sequentially from element
to element, a process called iterating through the
container. Incrimination in the iterators is done
with the ++ operator to point to the next element
and dereference it with the * operator to obtain
the value of the element they point to.
• There are three major classes of iterators:
forward using ++ operators, bidirectional using ++
and -- Operators and random access to jump to
any location.
• Two specialized kinds of iterators are also used
• An input iterator to read sequential data items into
a container from an input device.
• An output iterator can “point to” an output device
and write elements from a container to the device.
Function Objects:
Sequence Containers:
Lists:
Sets and Multisets:

More Related Content

What's hot

Data warehouse 18 logical dimensional model for data warehouse
Data warehouse 18 logical dimensional model for data warehouseData warehouse 18 logical dimensional model for data warehouse
Data warehouse 18 logical dimensional model for data warehouse
Vaibhav Khanna
 
C++
C++C++
Unit 1 Basic concepts to DS
Unit 1 Basic concepts to DSUnit 1 Basic concepts to DS
Unit 1 Basic concepts to DS
LavanyaJ28
 
L 15 ct1120
L 15 ct1120L 15 ct1120
L 15 ct1120
Zia Ush Shamszaman
 
Union from C and Data Strutures
Union from C and Data StruturesUnion from C and Data Strutures
Union from C and Data Strutures
Acad
 
Data structures
Data structures Data structures
Data structures
Chandra Shekhar
 
Machine learning - session 2
Machine learning - session 2Machine learning - session 2
Machine learning - session 2
Luis Borbon
 
1.3 data types
1.3 data types1.3 data types
1.3 data types
Digitorious Technologies
 

What's hot (8)

Data warehouse 18 logical dimensional model for data warehouse
Data warehouse 18 logical dimensional model for data warehouseData warehouse 18 logical dimensional model for data warehouse
Data warehouse 18 logical dimensional model for data warehouse
 
C++
C++C++
C++
 
Unit 1 Basic concepts to DS
Unit 1 Basic concepts to DSUnit 1 Basic concepts to DS
Unit 1 Basic concepts to DS
 
L 15 ct1120
L 15 ct1120L 15 ct1120
L 15 ct1120
 
Union from C and Data Strutures
Union from C and Data StruturesUnion from C and Data Strutures
Union from C and Data Strutures
 
Data structures
Data structures Data structures
Data structures
 
Machine learning - session 2
Machine learning - session 2Machine learning - session 2
Machine learning - session 2
 
1.3 data types
1.3 data types1.3 data types
1.3 data types
 

Similar to The Standard Template Library

Standard template library
Standard template libraryStandard template library
Standard template library
Sukriti Singh
 
Standard template library
Standard template libraryStandard template library
Standard template library
ThamizhselviKrishnam
 
Python Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptxPython Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptx
ShreyasLawand
 
Standard template library
Standard template libraryStandard template library
Standard template library
Jancypriya M
 
Unit 2 linear data structures
Unit 2   linear data structuresUnit 2   linear data structures
Unit 2 linear data structures
Senthil Murugan
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
Amar Jukuntla
 
Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
Kami503928
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
 
lecture 02.2.ppt
lecture 02.2.pptlecture 02.2.ppt
lecture 02.2.ppt
NathanielAdika
 
MODELLING WITH OBJECTS.pptx
MODELLING WITH OBJECTS.pptxMODELLING WITH OBJECTS.pptx
MODELLING WITH OBJECTS.pptx
Tarun710971
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)Hemant Jain
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
mexiuro901
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
OnkarModhave
 
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
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
MAJDABDALLAH3
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptx
poonamsngr
 
oops_final_ppt[1].pptx
oops_final_ppt[1].pptxoops_final_ppt[1].pptx
oops_final_ppt[1].pptx
12KrishnaPrasadH
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
Madishetty Prathibha
 
Data Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptxData Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptx
GIRISHKUMARBC1
 
10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx
huzaifaahmed79
 

Similar to The Standard Template Library (20)

Standard template library
Standard template libraryStandard template library
Standard template library
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
Python Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptxPython Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptx
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
Unit 2 linear data structures
Unit 2   linear data structuresUnit 2   linear data structures
Unit 2 linear data structures
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
 
Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
 
lecture 02.2.ppt
lecture 02.2.pptlecture 02.2.ppt
lecture 02.2.ppt
 
MODELLING WITH OBJECTS.pptx
MODELLING WITH OBJECTS.pptxMODELLING WITH OBJECTS.pptx
MODELLING WITH OBJECTS.pptx
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
 
introduction about data structure_i.pptx
introduction about data structure_i.pptxintroduction about data structure_i.pptx
introduction about data structure_i.pptx
 
oops_final_ppt[1].pptx
oops_final_ppt[1].pptxoops_final_ppt[1].pptx
oops_final_ppt[1].pptx
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
Data Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptxData Structure & aaplications_Module-1.pptx
Data Structure & aaplications_Module-1.pptx
 
10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx10-System-ModelingFL22-sketch-19122022-091234am.pptx
10-System-ModelingFL22-sketch-19122022-091234am.pptx
 

More from Munazza-Mah-Jabeen

Virtual Functions
Virtual FunctionsVirtual Functions
Virtual Functions
Munazza-Mah-Jabeen
 
Object-Oriented Software
Object-Oriented SoftwareObject-Oriented Software
Object-Oriented Software
Munazza-Mah-Jabeen
 
Templates and Exceptions
 Templates and Exceptions Templates and Exceptions
Templates and Exceptions
Munazza-Mah-Jabeen
 
Dictionaries and Sets
Dictionaries and SetsDictionaries and Sets
Dictionaries and Sets
Munazza-Mah-Jabeen
 
More About Strings
More About StringsMore About Strings
More About Strings
Munazza-Mah-Jabeen
 
Streams and Files
Streams and FilesStreams and Files
Streams and Files
Munazza-Mah-Jabeen
 
Lists and Tuples
Lists and TuplesLists and Tuples
Lists and Tuples
Munazza-Mah-Jabeen
 
Files and Exceptions
Files and ExceptionsFiles and Exceptions
Files and Exceptions
Munazza-Mah-Jabeen
 
Functions
FunctionsFunctions
Pointers
PointersPointers
Repitition Structure
Repitition StructureRepitition Structure
Repitition Structure
Munazza-Mah-Jabeen
 
Inheritance
InheritanceInheritance
Inheritance
Munazza-Mah-Jabeen
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
Munazza-Mah-Jabeen
 
Memory Management
Memory ManagementMemory Management
Memory Management
Munazza-Mah-Jabeen
 
Arrays and Strings
Arrays and StringsArrays and Strings
Arrays and Strings
Munazza-Mah-Jabeen
 
Objects and Classes
Objects and ClassesObjects and Classes
Objects and Classes
Munazza-Mah-Jabeen
 
Functions
FunctionsFunctions
Structures
StructuresStructures
Structures
Munazza-Mah-Jabeen
 
Loops and Decisions
Loops and DecisionsLoops and Decisions
Loops and Decisions
Munazza-Mah-Jabeen
 
C++ programming basics
C++ programming basicsC++ programming basics
C++ programming basics
Munazza-Mah-Jabeen
 

More from Munazza-Mah-Jabeen (20)

Virtual Functions
Virtual FunctionsVirtual Functions
Virtual Functions
 
Object-Oriented Software
Object-Oriented SoftwareObject-Oriented Software
Object-Oriented Software
 
Templates and Exceptions
 Templates and Exceptions Templates and Exceptions
Templates and Exceptions
 
Dictionaries and Sets
Dictionaries and SetsDictionaries and Sets
Dictionaries and Sets
 
More About Strings
More About StringsMore About Strings
More About Strings
 
Streams and Files
Streams and FilesStreams and Files
Streams and Files
 
Lists and Tuples
Lists and TuplesLists and Tuples
Lists and Tuples
 
Files and Exceptions
Files and ExceptionsFiles and Exceptions
Files and Exceptions
 
Functions
FunctionsFunctions
Functions
 
Pointers
PointersPointers
Pointers
 
Repitition Structure
Repitition StructureRepitition Structure
Repitition Structure
 
Inheritance
InheritanceInheritance
Inheritance
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Arrays and Strings
Arrays and StringsArrays and Strings
Arrays and Strings
 
Objects and Classes
Objects and ClassesObjects and Classes
Objects and Classes
 
Functions
FunctionsFunctions
Functions
 
Structures
StructuresStructures
Structures
 
Loops and Decisions
Loops and DecisionsLoops and Decisions
Loops and Decisions
 
C++ programming basics
C++ programming basicsC++ programming basics
C++ programming basics
 

Recently uploaded

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
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
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 

Recently uploaded (20)

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
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 ...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 

The Standard Template Library

  • 1. Standard Template Library: Chapter 15: Ms. Munazza Mah Jabeen Assistant Professor of Computer Science
  • 2. Introduction to the STL: The STL contains several kinds of entities. The three most important are containers, algorithms, and iterators. • A container is a way that stored data is organized in memory. E.g. stacks, linked lists, array etc. • Sequence - vector, list, and deque uses keys • Associative - set, multiset, map, multi-map uses tree and key –value pair to access the values • Derived Sequence Containers - stack, queue, and priority queue • Algorithms in the STL are procedures that are applied to containers to process their data in various ways e.g. sort, copy, search and merge data. • Iterators are a generalization of the concept of pointers: they point to elements in a container.
  • 6. Iterators: • Iterators are pointer-like entities that are used to access individual data items called elements. • They are used to move sequentially from element to element, a process called iterating through the container. Incrimination in the iterators is done with the ++ operator to point to the next element and dereference it with the * operator to obtain the value of the element they point to. • There are three major classes of iterators: forward using ++ operators, bidirectional using ++ and -- Operators and random access to jump to any location. • Two specialized kinds of iterators are also used • An input iterator to read sequential data items into a container from an input device. • An output iterator can “point to” an output device and write elements from a container to the device.