import java.applet.Applet;
import java.awt.*;
import Point;
public class demo extends Applet 
  {
    static void clear(Graphics page, Color c)
      { 
        int h = page.getClipBounds().height;
        int w = page.getClipBounds().width;
        page.setColor(c);
        page.fillRect(0, 0, w, h);
      }
    public void paint(Graphics page)
      {
        int alg = Integer.parseInt(getParameter("algorithm"));
        int V = Integer.parseInt(getParameter("V"));
        int delay = Integer.parseInt(getParameter("delay"));
        double d = Math.sqrt(4.0/V);
        Graph G = new Graph(V, d);
        clear(page, Color.lightGray);
        G.paint(page);
        if (alg == 1) G.dfs(delay);
        if (alg == 2) G.bfs(delay);
      }	    
  }

