Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
Question
Book Icon
Chapter 18.2, Problem 8STE
Program Plan Intro

STL Basic sequential containers:

“slist”:

  • The template class for “slist” class is “<slist>”
  • The template class for “slist” is “slist<T>::iterator”.
    • This class uses mutable and forward iterator.
  • The template class for constant iterator is “slist<T>::const_iterator”.
    • This class uses constant and forward iterator.

“list”:

  • The template class for “list” class is “<list>”
  • The template class for “list” is “list<T>::iterator”.
    • This class uses mutable and bidirectional iterator.
  • The template class for constant iterator is “list<T>::const_iterator”.
    • This class uses constant and bidirectional iterator.
  • The template class for reverse iterator is “list<T>::reverse_iterator”.
    • This class uses mutable and bidirectional iterator.
  • The template class for constant reverse iterator is “list<T>::const_reverse_iterator”.
    • This class uses constant and bidirectional iterator.

vector”:

  • The template class for “vector” class is “<vector>”
  • The template class for “vector” is “vector<T>::iterator”.
    • This class uses mutable, random, and access iterator.
  • The template class for constant iterator is “vector<T>::const_iterator”.
    • This class uses constant, random, and access iterator.
  • The template class for reverse iterator is “vector<T>::reverse_iterator”.
    • This class uses mutable, random, and access iterator.
  • The template class for constant reverse iterator is “vector<T>::const_reverse_iterator”.
    • This class uses constant, random, and access iterator.

“deque”:

  • The template class for “deque” class is “<deque>”
  • The template class for “deque” is “deque<T>::iterator”.
    • This class uses mutable, random, and access iterator.
  • The template class for constant iterator is “deque<T>::const_iterator”.
    • This class uses constant, random, and access iterator.
  • The template class for reverse iterator is “deque<T>::reverse_iterator”.
    • This class uses mutable, random, and access iterator.
  • The template class for constant reverse iterator is “deque<T>::const_reverse_iterator”.
    • This class uses constant, random, and access iterator.

Blurred answer
Students have asked these similar questions
Template Specialization in c++ is used to write generic code. Template code is written once and use for any data type including user-defined data types.Example: sort() can be written and used to sort any data type items. Create a Template code that reads input from the user, user can enter any type of data like integer, double, float.sum() is the template method that can take any two types of data and add it and return the sum of the two numbers.Create a Template Specialization method to add two integer values only.If a specialized version is present, the compiler first checks with the specialized version and then the main template.  Sample Input  and Output:Enter two integer Numbers: 55Enter two float Numbers: 3.53.1Enter two double Numbers: 3.68.6Sum of two integer Numbers: only integer10Sum of two float Numbers: 6.6Sum of two double Numbers: 12.2
Given a template class named indexList, the prototype of one of its member function is as follows: bool replace (int index, const T &item); When implementing, what is the prototype (the first two lines only) of the replace function? The body of the function is not needed. A B I EE % $5 3
Extend the class linkedListType by adding the following operations: Write a function that returns the info of the kth element of the linked list. If no such element exists, terminate the program. Write a function that deletes the kth element of the linked list. If no such element exists, terminate the program. Provide the definitions of these functions in the class linkedListType. Also, write a program to test these functions. (Use either the class unorderedLinkedList or the class orderedLinkedList to test your function.)
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education