mirror of
https://github.com/koloideal/SortLab.git
synced 2026-06-10 10:25:30 +03:00
update
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
#include "Sorter.hpp"
|
||||
|
||||
class SelectionSorter : public Sorter {
|
||||
public:
|
||||
SelectionSorter();
|
||||
|
||||
void step(Array& array) override;
|
||||
bool isFinished() const override;
|
||||
std::string getName() const override;
|
||||
void reset() override;
|
||||
|
||||
private:
|
||||
enum class Phase { FINDING_MIN, SWAPPING, NEXT };
|
||||
|
||||
int i_;
|
||||
int j_;
|
||||
int minIndex_;
|
||||
int n_;
|
||||
bool finished_;
|
||||
Phase phase_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user