Every topic starts at New. Sign in and your practice counts.
The problems could be specific, but the best solution needs to be generic. The specific solution could only handle that particular situation that is being faced at any particular time. However, the generic solution could be any time to handle similar problems. This way, we can enhance efficiency, scalability and reusability of our solutions.
To understand the core problem, first your need to understand specific cases of problems. Among these specific cases of problems, identify the essential components that are common across different cases.
Identify Repeated patterns, In problems, there are some elements that occur periodically, identify such elements. Bifurcate the elements whether they are specific to the examples or could be applied more broadly.
This figure is being prepared.
Steps to Create Generalized Solutions
2>> Test the solution with a wide range of inputs to ensure validity of solution in different scenarios. If needed, modify your solution based on test results.
Specific Case: In sorting algorithms, the Bubble Sort is a specific solution that works by swapping adjacent elements and this swapping is performed repeatedly, until we get a sorted list of items.
Generalized Solution: This sorting concept, however, could be generalized, as we have various algorithms for this purpose e.g. Quick Sort, Merge Sort, and Heap Sort. Each of the above algorithms use different strategies to sort the list of items, however, end result of each algorithm is same.