Strategy Pattern
Strategy pattern makes sure that Open close principle of SOLID principle is not violated. Open Closed Principle. Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. The main idea behind this one is that in one part of your code, you have your abstractions such as classes, modules, higher order functions that do one thing and do it well.
In the sorter manager class we just need to call sorter.sort(); This is a perfect abstraction and this is what strategy pattern is because it does not know
So now if we need to make say QUICKSORT. Now we just need to add a class for quicksort and that’s it.