- Get link
- X
- Other Apps
Can you solve this problem? Given an array, find the largest value in the array. Is that a computational problem? What is a Computational problem? The problem above is not a computational problem. The array given as the input to the problem above is not well-defined . It could be any of the following [null, null, null], ["hello", "Douglas", "world"], [1, 3, 4, 5], [1, 1, 1, 1], [], [2.5, 6.6, 8.9, 10.0] ...... and many more ... From the examples, since the array is not well-defined, you cannot write a correct algorithm, because depending on the kind of input array it is, your algorithm is going to be completely different. In some cases, for example, given an array of nulls, you cannot do a comparison to get the largest value and therefore you cannot write a correct algorithm. Even in the case where the array is specified as an array of integers, depending on whether the array is sorted or not, you are going to end up writing a completely different alg...