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
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include "Sorter.hpp"
class BubbleSorter : public Sorter {
public:
BubbleSorter();
void step(Array& array) override;
bool isFinished() const override;
std::string getName() const override;
void reset() override;
private:
enum class Phase { COMPARING, SWAPPING, NEXT };
int i_;
int j_;
int n_;
bool finished_;
Phase phase_;
};