Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 18.2, Problem 9STE
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.
“
- 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.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
You are tasked to implement an abstract data type class which takes in a given input file called input.txt,
and processes, identifies and sorts all unique word instances found in the file.
Sample Input
Hi hello hi good bye goodbye Bye bye good say
Sample Output
Bye Hi bye hello hi say
The input.txt file is found along with the zip folder where this instructions file also came along with.
Note: you are not allowed to use pythonic lists, and its methods and functions, and string methods.
However the use of the file handling methods (read readlines and readline) are allowed for this project.
Answer for.Write a Python Code for the given constructor and conditions:
Given Constructor: def __init__ (self, a)
Pre-condition: Array cannot be empty.
Post-condition: This is the default constructor of MyList class. This constructor creates a list from an array..
Write a template for a function that has parameters for a list of items and for a possible item on the list. If the item is on the list, then the function returns the position of the first occurrence of that item. If the item is not on the list, the function returns −1. The first position on the list is position 0, the next is position 1, and so forth. The type of the items on the list is a type parameter. Use the class template GenericList that you defined in Project 1. Write a suitable program(main function) to test this function template.
Chapter 18 Solutions
Problem Solving with C++ (10th Edition)
Ch. 18.1 - If v is a vector, what does v.begin() return? What...Ch. 18.1 - If p is an iterator for a vector object v, what is...Ch. 18.1 - Suppose v is a vector of ints. Write a for loop...Ch. 18.1 - Suppose the vector v contains the letters 'A',...Ch. 18.1 - Suppose the vector v contains the letters 'A',...Ch. 18.1 - Suppose you want to run the following code, where...Ch. 18.2 - Prob. 7STECh. 18.2 - Prob. 8STECh. 18.2 - Prob. 9STECh. 18.2 - Prob. 10STE
Ch. 18.2 - Prob. 11STECh. 18.2 - Prob. 12STECh. 18.2 - Prob. 13STECh. 18.2 - Prob. 14STECh. 18.2 - Prob. 15STECh. 18.2 - Prob. 16STECh. 18.3 - Prob. 17STECh. 18.3 - Prob. 18STECh. 18.3 - Prob. 19STECh. 18.3 - Suppose v is an object of the class vectorint. Use...Ch. 18.3 - Prob. 21STECh. 18.3 - Can you use the copy template function with vector...Ch. 18.3 - Prob. 23STECh. 18 - Prob. 1PCh. 18 - Prob. 2PCh. 18 - Prob. 3PCh. 18 - Prob. 4PCh. 18 - Write a program that allows the user to enter any...Ch. 18 - Prob. 3PPCh. 18 - Prob. 5PPCh. 18 - Solution to Programming Project 18.6 In this...Ch. 18 - Prob. 7PPCh. 18 - You have collected a file of movie ratings where...Ch. 18 - Prob. 9PPCh. 18 - Prob. 11PPCh. 18 - Write a program that uses regular expressions to...
Knowledge Booster
Similar questions
- How does the function insertFirst of the class unorderedLinkedList differ from the function insertFirst of the class orderedLinkedList.arrow_forwardAdd the function min as an abstract function to the class arrayListType to return the smallest element of the list. Also, write the definition of the function min in the class unorderedArrayListType and write a program to test this function. I have 5 tabs: I have tried every solution I can think of with no luck. These are the guides: arrayListType.h arrayListTypeImp.cpp: main.cpp unorderedArraryListType.h unorderedArrayListTypeImp.cpp I am needing these in order to pass the assignment in Cengage Mindtap, please help with codes for each one if possible.arrow_forwardWhich of the template classes slist, list, vector, and deque have the member function push_back?arrow_forward
- Write a function, to be included in an unsorted linked list class, called replace_item, that will receive two parameters, one called olditem, the other called newitem. The function will replace all occurrences of olditem with newitem ( if olditem exists !! ) and it will return the number of replacements done.arrow_forwardCOMPLETE THIS CODE and make sure it passes all the test cases.// EXERCISE 4.1 MYLIST ITERATIVE CATENATE MUTATE /** * Catenate two MyLists, listA and listB. Mutate listA. * @param listA is a MyList object. * @param listB is a MyList object. * @return a list consisting of the elements of listA followed by the * elements of listB. */public static MyList iterCatMutList(MyList listA, MyList listB) { }arrow_forwardWhat would be missing line of codearrow_forward
- Develop a class ResizingArrayQueueOfStrings that implements the queueabstraction with a fixed-size array, and then extend your implementation to use arrayresizing to remove the size restriction.Develop a class ResizingArrayQueueOfStrings that implements the queueabstraction with a fixed-size array, and then extend your implementation to use arrayresizing to remove the size restriction.arrow_forwardHelp with c++... please paste indented code plzz and keep output same as givenarrow_forwardCreate an implementation of a doubly linked DoubleOrderedList class. You will need to create a DoubleNode class, a DoubleList class, and a DoubleIterator classarrow_forward
- Write a template function that takes as parameter a vector of a generic type and reverses the order of elements in the vector, and then add the function to the program you wrote for Programming Challenge 5. Modify the driver program to test the new function by reversing and outputting vectors whose element types are char, int, double, and string.arrow_forwardAdd the following operation to the class orderedLinkedList: void mergeLists(orderedLinkedList<Type> &list1, orderedLinkedList<Type> &list2); //This function creates a new list by merging the //elements of list1 and list2. //Postcondition: first points to the merged list // list1 and list2 are empty Consider the following statements: orderedLinkedList<int> newList; orderedLinkedList<int> list1; orderedLinkedList<int> list2; Suppose list1 points to the list with the elements 2 6 7, and list2 points to the list with the elements 3 5 8. The statement newList.mergeLists(list1, list2); creates a new linked list with the elements in the order 2 3 5 6 7 8, and the object newList points to this list. Also, after the preceding statement executes, list1 and list2 are empty. 2. Write the definition of the function template mergeLists to implement the operation mergeLists.arrow_forwardProvide an explanation for the primary distinction that exists here between collection and an arraylist.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education