summaryrefslogtreecommitdiff
path: root/tests/BubbleSort-error.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-03-27 13:09:08 -0600
committerbd-912 <bdunahu@colostate.edu>2024-03-27 13:09:08 -0600
commit8131ddc22af5d39114a55349d71bcdc467599187 (patch)
tree9aaa7b984f223b1b405bb1598982ea992eeba67d /tests/BubbleSort-error.java
parente8af241aa57104d62c25c8bcbc2df76510998bf9 (diff)
Expand file structure, Vaporize skeleton
Diffstat (limited to 'tests/BubbleSort-error.java')
-rw-r--r--tests/BubbleSort-error.java93
1 files changed, 0 insertions, 93 deletions
diff --git a/tests/BubbleSort-error.java b/tests/BubbleSort-error.java
deleted file mode 100644
index 97a1c1d..0000000
--- a/tests/BubbleSort-error.java
+++ /dev/null
@@ -1,93 +0,0 @@
-class BubbleSort{
- public static void main(String[] a){
- System.out.println(new BBS().Start(10));
- }
-}
-
-
-// This class contains the array of integers and
-// methods to initialize, print and sort the array
-// using Bublesort
-class BBS{
-
- 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(99999);
- aux01 = this.Sort();
- aux01 = this.Print();
- return 0 ;
- }
-
-
- // Sort array of integers using Bublesort method
- public int Sort(){
- int nt ;
- int i ;
- int aux02 ;
- int aux04 ;
- int aux05 ;
- int aux06 ;
- int aux07 ;
- int j ;
- int t ;
- i = size - 1 ;
- aux02 = 0 - 1 ;
- while (aux02 < i) {
- j = 1 ;
- //aux03 = i+1 ;
- while (j < (i+1)){
- aux07 = j - 1 ;
- aux04 = number[aux07] ;
- aux05 = number[j] ;
- if (aux05 < aux04) {
- aux06 = j - 1 ;
- t = number[aux06] ;
- number[aux06] = number[j] ;
- number[j] = t;
- }
- else nt = 0 ;
- j = j + 1 ;
- }
- i = i - 1 ;
- }
- return 0 ;
- }
-
- // Printing method
- public int Print(){
- int j ;
- j = 0 ;
- while (j < (size)) {
- System.out.println(number[j]);
- j = j + 1 ;
- }
- return 0 ;
- }
-
- // Initialize array of integers
- public int Init(int sz){
- size = sz1 ; //TE
- number = new int[sz] ;
-
- number[0] = 20 ;
- number[1] = 7 ;
- number[2] = 12 ;
- number[3] = 18 ;
- number[4] = 2 ;
- number[5] = 11 ;
- number[6] = 6 ;
- number[7] = 9 ;
- number[8] = 19 ;
- number[9] = 5 ;
-
- return 0 ;
- }
-
-}