Question: Question 1. [5 marks] Using the example of the Trip Planning Software discussed in class suppose that the PlanningService class needs to sort trips using

 Question 1. [5 marks] Using the example of the Trip Planning

Question 1. [5 marks] Using the example of the Trip Planning Software discussed in class suppose that the PlanningService class needs to sort trips using one of the following algorithms: bubble sort, heap sort, or quick sort. The selection of an algorithm will depend on the context in which the collection of trips is used: sometimes a bubble sort should be used, sometimes a heap sort, etc. Which design pattern would you use to allow for the selection of any of these sorting algorithms at run time, and for the possibility of adding new such algorithms in future releases? Once you have selected an appropriate design pattern, justify your choice by listing the needs of the problem that correspond to the intent of the pattern. You are also asked to show in a class diagram how the use of the pattern would look like

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!