SkyLine的启动类和主要方法

时间:2018-07-05 04:35:58

标签: java

我需要示例主方法(用于启动),该代码具有伪造的数据(Skyline分治法)

链接:https://github.com/mouhyi/Algorithms/blame/master/SkyLine.java

示例代码:

public static class runClass {
        public static void main(String[] args)
        {
            Building[] arr = {{1, 11, 5}, {2, 6, 7}, {3, 13, 9},
                    {12, 7, 16}, {14, 3, 25}, {19, 18, 22},
                    {23, 13, 29}, {24, 4, 28}};
        }

    }

1 个答案:

答案 0 :(得分:0)

该算法需要Building对象的数组,而不是2维整数数组。 Building类是在SkyLine类内部定义的,因此这是定义数据的方式。

public static void main(String[] args) {
    SkyLine.Building[] arr = new Building[] {
        new SkyLine.Building(1, 11, 5),
        new SkyLine.Building(2, 6, 7),
        new SkyLine.Building(3, 13, 9),
        new SkyLine.Building(12, 7, 16),
        new SkyLine.Building(14, 3, 25),
        new SkyLine.Building(19, 18, 22),
        new SkyLine.Building(23, 13, 29),
        new SkyLine.Building(24, 4, 28)
    };
}