Lab 3.docx - set.h#ifndef_SET_H#define_SET_H#include <cstdlib>#include <iostream> class set public typedef int value_type typedef std:size_t size_type

Lab 3.docx - set.h#ifndef_SET_H#define_SET_H#include...

This preview shows page 1 - 2 out of 5 pages.

set.h #ifndef _SET_H_ #define _SET_H_ #include <cstdlib> #include <iostream> class set { public: typedef int value_type; typedef std::size_t size_type; set(size_type initial_capacity); // postcondition: empty set with initial_capacity has been created ~set(); // postcondition: all dynamically allocated memory has been deallocated set(const set& s); // copy of s has been created; set& operator= (const set& s); // postcondition: exact copy of s has been assigned to the current set object bool erase(const value_type& target); // postcondition: returned true if target was removed from set ow false if target was not in the set bool insert(const value_type& entry); // postcondition: if entry was not in the set, then entry has been added - ow nothing was done void operator+=(const set& addend); // postcondition: non-duplicating elements from addend have been added to the set size_type size() const; // postcondition: number of elements in the set has been returned bool contains(const value_type& target) const; // postcondition: returned whether target is in the set
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Fall '18
  • Monisha Verma

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes