Problem Solving with C++, Student Value Edition
Problem Solving with C++, Student Value Edition
10th Edition
ISBN: 9780134543680
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
Chapter 18.2, Problem 16STE
Program Plan Intro

Member function in “set” template class:

The member function for “set” template class is shown below:

  • “s.insert(Value)”:
    • This function is used to inserts a copy of “Value” in the set.
    • If “Value” is already in the set, this has no effect.
  • “s.erase(Value)”:
    • It is used to removes “Value” from the set.
    • If “Value” is already in the set, this has no effect.
  • “s.find(Value)”:
    • This function is used to returns a mutable iterator placed at the copy of “Value” in the set.
    • If “Value” is not in the set, then “s.end()” is returned.
  • “s.erase(Iterator)”:
    • This function is used to erase the value at the location of the “Iterator”.
  • “s.size()”:
    • This function is used to returns the number of elements in the set.
  • “s.empty()”:
    • This function returns “true” if the set is empty.
    • Otherwise, returns “false”.
  • “s1 == s2”:
    • This function returns “true” if the set contains the same elements.
    • Otherwise returns “false”.

Blurred answer
Students have asked these similar questions
You dont need to implement foo
The binary search method requires just which of the following?
Where can you find MIN_VALUE and MAX_VALUE constants? Java doesn't have constants In StringTokenizer class In primitive data types In wrapper classes
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning