i just added a flood fill feature to my paint program. it works just fine but it is a bit too slow for my liking. after solving 48 euler project problems, i am thinking there must be a way to speed this up. to flood fill most of the screen on my antique laptop takes about 2 minutes.
i solved the problem. i was thinking it was the foreach loop to check each point before adding it to the queue to make sure it is not already there. i was thinking it would be nice if ArrayDeque had a contains() method. then i thought it would have to do the same thing i do so maybe it wouldn't help. when i finally got a chance to check the API, it turns out there is a contains() method. it works about 8 times as fast now
less code too