Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exam, you will write a C++ class IntSet that maintains a set of integers and has the following methods: IntSet(), the constructor that

In this exam, you will write a C++ class IntSet that maintains a set of integers and has the following methods:

  • IntSet(), the constructor that creates an empty integer set.
  • int isMember(int i), check if the input integer i is a member of the set, return 1 if it is, otherwise return 0.
  • int insert(int i), insert integer i into the set, return 1 if the insert is successful, and 0 otherwise.
  • int delete(int i), delete integer i from the set, return 1 if i is deleted from the set, and 0 if i is not in the set.
  • void print(), print out all the elements of the set to the screen.
  • IntSet IntSet::union(IntSet S), return the union of this set and the input set S.

IntSet IntSet::intersection(IntSet S), return the intersection of this set and the input set S

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago