Skip to content

BUBBLE SORT is based on the idea of repeatedly comparing pairs of adjacent elements, then switching positions if they exist in the wrong order.

Notifications You must be signed in to change notification settings

xxbrigettexx/bubble-sort

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Bubble Sort

Description

  • BUBBLE SORT is based on the idea of repeatedly comparing pairs of adjacent elements, then switching positions if they exist in the wrong order.
  • It's worse case algorithmic time complexity is QUADRATIC or O(n^2).

To Do:

  • Accepts keyboard input to set size of array.
  • Generate random numbers to array accordingly.
  • Show unsorted random numbers.
  • Show sorted numbers after.

Pseudocode:

START PROGRAM

 FOR each number IN array
  IF array[i] > array[i+1]
     swap([i], array[i+1])

END PROGRAM 

About

BUBBLE SORT is based on the idea of repeatedly comparing pairs of adjacent elements, then switching positions if they exist in the wrong order.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%