1. Strategy 2. Strategy Define a family of algorithms,encapsulate each in a separateclass and define each class withthe same interface so that they canbe interchangeable.…