ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::QuicksortAdversary Class Reference

the adversary of McIlroy: a comparator of \( n \) items that gives them their values while a quicksort runs More...

#include <ADS/sort/QuicksortAdversary.h>

Classes

class  Less
 the comparator to pass to a sort, by value: a pointer to the adversary, which must outlive it More...

Public member functions

 QuicksortAdversary (std::size_t n)
 the adversary of the items \( 0 , \ldots , n - 1 \), all gas
Less less (void)
 the comparator of this adversary
std::vector< std::size_t > items (void) const
 the items to sort, \( 0 , \ldots , n - 1 \)
std::size_t comparisons (void) const
 the number of calls of the comparator so far
std::vector< std::size_t > input (void) const
 the value of each item, the gas frozen in the order of the items after the frozen ones: an input of \( n \) distinct values on which a deterministic sort makes the comparisons it made here

Detailed description

the adversary of McIlroy: a comparator of \( n \) items that gives them their values while a quicksort runs

Constructor and destructor documentation

◆ QuicksortAdversary()

ADS::QuicksortAdversary::QuicksortAdversary ( std::size_t n)
explicit

the adversary of the items \( 0 , \ldots , n - 1 \), all gas

Member function documentation

◆ comparisons()

std::size_t ADS::QuicksortAdversary::comparisons ( void ) const
inlinenodiscard

the number of calls of the comparator so far

◆ input()

std::vector< std::size_t > ADS::QuicksortAdversary::input ( void ) const
nodiscard

the value of each item, the gas frozen in the order of the items after the frozen ones: an input of \( n \) distinct values on which a deterministic sort makes the comparisons it made here

Postcondition
a permutation of \( 0 , \ldots , n - 1 \)

◆ items()

std::vector< std::size_t > ADS::QuicksortAdversary::items ( void ) const
nodiscard

the items to sort, \( 0 , \ldots , n - 1 \)

◆ less()

Less ADS::QuicksortAdversary::less ( void )
inlinenodiscard

the comparator of this adversary


The documentation for this class was generated from the following file: