previous | start | next

## Algorithm Animation

- Use thread to make progress in algorithm
- Display algorithm state
- Example: Animate Ch9/animation/MergeSorter.java
- Pause inside compare method
- Pass custom comparator
  Comparator comp = new
  Comparator()
  {
  public void compare(Object o1, Object o2)
  {
  draw current state
  pause thread
  return comparison result
  }
  };

previous | start | next