From 1851f5e76018ec1df3b55dce6cc9a64c9497bf7a Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 26 Apr 2024 15:50:38 -0600 Subject: Rearrange directory structure --- base/QuickSort-error.java | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 base/QuickSort-error.java (limited to 'base/QuickSort-error.java') diff --git a/base/QuickSort-error.java b/base/QuickSort-error.java new file mode 100644 index 0000000..ff4ea2e --- /dev/null +++ b/base/QuickSort-error.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 ; //TE + 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