Class ImprovedBubble

java.lang.Object
topics.sorting.ImprovedBubble
All Implemented Interfaces:
ISortingAlgorithm

public class ImprovedBubble extends Object implements ISortingAlgorithm
Sorting algorithm: Bubble method with sentinel
Author:
vicegd
  • Constructor Details

    • ImprovedBubble

      public ImprovedBubble()
  • Method Details

    • sort

      public void sort(int[] elements)
      Description copied from interface: ISortingAlgorithm
      Sorts elements without tracing anything
      Specified by:
      sort in interface ISortingAlgorithm
      Parameters:
      elements - Array of numbers to be sorted
    • sort

      public void sort(int[] elements, boolean trace)
      Description copied from interface: ISortingAlgorithm
      Sorts elements with the possibility of tracing the operation
      Specified by:
      sort in interface ISortingAlgorithm
      Parameters:
      elements - Array of numbers to be sorted
      trace - Whether to trace the operation performed