Class: Sorting::IntroSort

Inherits:
Object
  • Object
show all
Extended by:
Helper
Defined in:
lib/sorting/intro_sort.rb

Constant Summary collapse

TEST_DATA_SIZE =
100_000
SIZE_FOR_INSERTION =
12

Class Method Summary collapse

Methods included from Helper

sort

Class Method Details

.sort!(data) ⇒ Object

Introsort or introspective sort Comparison sort Partitioning & Selection Unstable Time complexity: O(nlogn), Ө(nlogn), O(nlogn) Space complexity: O(logn) Support parallelization Better to median-of-3 killer



18
19
20
21
# File 'lib/sorting/intro_sort.rb', line 18

def self.sort!(data)
  introsort(data)
  nil
end