Generics & Open recursion
1. Generics
If you are a fan of reusing code then generic programming is your best friend! Generics offer the possibility for primitive data types and user-defined types to be passed as an argument for functions (geeksforgeeks, 2019)
By taking generic programming into consideration, you should be able to solve problems that require applying the same algorithm with all data types, for the reason that the main purpose of using Generics is to avoid repeating the same algorithm when the only variable is the data type.