This commit is contained in:
2026-03-02 15:48:49 +03:00
parent 7cdd2068be
commit d87484393d
21 changed files with 986 additions and 7 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include "Sorter.hpp"
#include <vector>
class QuickSorter : public Sorter {
public:
QuickSorter();
void step(Array& array) override;
bool isFinished() const override;
std::string getName() const override;
void reset() override;
private:
enum class Phase { PARTITIONING, SWAPPING_PIVOT, PUSHING_RANGES };
struct Range {
int low;
int high;
};
std::vector<Range> stack_;
int currentLow_;
int currentHigh_;
int pivotIndex_;
int i_;
int j_;
float pivotValue_;
bool finished_;
Phase phase_;
int n_;
};