From 12f1e24766b061e00663e1934b76f64cd79c8fea Mon Sep 17 00:00:00 2001 From: bd-912 Date: Mon, 4 Mar 2024 22:53:58 -0700 Subject: Minimal test suite---failing tests --- tests/QuickSort.java | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 tests/QuickSort.java (limited to 'tests/QuickSort.java') diff --git a/tests/QuickSort.java b/tests/QuickSort.java new file mode 100644 index 0000000..5893390 --- /dev/null +++ b/tests/QuickSort.java @@ -0,0 +1,112 @@ +class QuickSort{ + public static void main(String[] a){ + System.out.println(new QS().Start(10)); + } +} + + +// This class contains the array of integers and +// methods to initialize, print and sort the array +// using Quicksort +class QS{ + + int[] number ; + int size ; + + // Invoke the Initialization, Sort and Printing + // Methods + public int Start(int sz){ + int aux01 ; + aux01 = this.Init(sz); + aux01 = this.Print(); + System.out.println(9999); + aux01 = size - 1 ; + aux01 = this.Sort(0,aux01); + aux01 = this.Print(); + return 0 ; + } + + + // Sort array of integers using Quicksort method + public int Sort(int left, int right){ + int v ; + int i ; + int j ; + int nt; + int t ; + boolean cont01; + boolean cont02; + int aux03 ; + t = 0 ; + if (left < right){ + v = number[right] ; + i = left - 1 ; + j = right ; + cont01 = true ; + while (cont01){ + cont02 = true ; + while (cont02){ + i = i + 1 ; + aux03 = number[i] ; + if (!(aux03