每行N的数理是2的N次方。

解决方案 »

  1.   

    jfreechart不知道能不能画这么高级的图哇。算法倒是简单。
      

  2.   

    有规律没?
    没规律就估算个位置画啊。
    BufferedImage image = new BufferedImage(width, height,
    BufferedImage.TYPE_INT_RGB);
    Graphics g = image.getGraphics();
    g.setColor(Color.black);
    g.drawRect(0, 0, width, height);
    g.drawString(str,x, y);
    ......
    g.dispose();
    response.setContentType("image/jpeg");
    out.clear();
    out = pageContext.pushBody();
    OutputStream strm = response.getOutputStream();
    ImageIO.write(image, "jpeg", strm);
    strm.close();
      

  3.   

    1  JFreeChart肯定不能。
    2  每行显示的数据只是一个算法的问题。
    3  图形显示BufferedImage,但显示的位置比较麻烦
    4  能否从TreeNode得到点启发?
      

  4.   

    没考虑溢出,只用了int。public static void main(String[] args) { for(int i=0;i<10;i++){
    if(i%2!=0){
    for(int j=0;j<Math.pow(2,i);j++){
    System.out.print((int)Math.pow(2,i)+j+" ");
    }

    }else{
    for(int j=1;j<=Math.pow(2,i);j++){
    System.out.print((int)Math.pow(2,i+1)-j+" ");
    }
    }
    System.out.println();
    }


    }