Princeton1/clients/src/main/java/com/hithomelabs/clients/Benchmarks/BenchMarkingClient.java
hitanshu310 8c47ac248c Adding benchmarking code (#17)
Reviewed-on: Hithomelabs/Princeton1#17
Reviewed-by: kruti <krutis0201@gmail.com>
Co-authored-by: hitanshu310 <hitanshu98@gmail.com>
Co-committed-by: hitanshu310 <hitanshu98@gmail.com>
2025-02-19 19:53:59 +00:00

42 lines
1.3 KiB
Java

package com.hithomelabs.clients.Benchmarks;
import com.hithomelabs.princeton1.common.Apple;
import com.hithomelabs.princeton1.module5.Insertion;
import com.hithomelabs.princeton1.module5.MeasurableSort;
import com.hithomelabs.princeton1.module5.Selection;
import com.hithomelabs.princeton1.module5.Shell;
import com.hithomelabs.princeton1.module6.Merge;
import com.hithomelabs.princeton1.module7.Quick;
import com.hithomelabs.princeton1.module7.ThreeWayQuick;
import com.hithomelabs.princeton1.module8.HeapSort;
import java.util.ArrayList;
import java.util.List;
public class BenchMarkingClient {
public static void main(String[] args) {
List<MeasurableSort<Apple>> algorithms = new ArrayList<MeasurableSort<Apple>>();
algorithms.add(new Selection<Apple>());
algorithms.add(new Insertion<Apple>());
algorithms.add(new Shell<Apple>());
algorithms.add(new Merge<Apple>());
algorithms.add(new Quick<Apple>());
algorithms.add(new ThreeWayQuick<Apple>());
algorithms.add(new HeapSort<Apple>());
BenchMark b1 = new BenchMark(32, algorithms);
BenchMark b2 = new BenchMark(512, algorithms);
BenchMark b3 = new BenchMark(1024, algorithms);
BenchMark b4 = new BenchMark(4096,algorithms);
//b1.run();
//b2.run();
//b3.run();
b4.run();
}
}