12.05.2015 Views

type - David Vernon

type - David Vernon

type - David Vernon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Object-Oriented Programming<br />

A Class for Sets<br />

• Required data <strong>type</strong>: sets of integers<br />

• Required functions:<br />

– declaration, e.g.<br />

iset S, T=1000, U=T, V(1000);<br />

»Sshould be empty<br />

» T, U, and V should contain just one element (1000)<br />

– adding an element, e.g.<br />

S += x<br />

– removing an element, e.g.<br />

S -= x<br />

» must be valid even if x is not an element of S<br />

Copyright © 2007 <strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!