Algorithm Animation
- Use thread to make progress in algorithm
- Display algorithm state
- Example: Animate Ch9/animation/Sorter.java
- Sleeps inside compare method
- Pass custom comparator
Comparator<Double> comp = new
Comparator<Double>()
{
public void compare(Double d1, Double d2)
{
sleep
return
comparison result
}
};