Context (Sorter):?
- The Sorter class acts as the context that uses the strategy. It has a method
SetStrategy that allows clients to set the desired sorting strategy dynamically. The
Sort method delegates the sorting task to the currently set strategy.
public class Sorter
private ISortStrategy _strategy;
public void SetStrategy(ISortStrategy strategy) => _strategy =
strategy;
public void Sort(List<int> list) => _strategy.Sort(list);