15 lines
479 B
C#
15 lines
479 B
C#
namespace SortingVisualization {
|
|
public abstract class SortingAlgorithm {
|
|
public abstract void Sort(ref DataSet set);
|
|
public abstract string GetAlgorithmName();
|
|
public void Simulate(ref DataSet set) {
|
|
if (!set.SimulateMode) {
|
|
set.SimulateMode = true;
|
|
Sort(ref set);
|
|
set.SimulateMode = false;
|
|
set.SortingAlgorithm = this.GetAlgorithmName();
|
|
}
|
|
}
|
|
}
|
|
}
|