It is an algorithm that searches for an element one by one in an array, until the target element is found. Consider if X is an element to be searched in an array, then linear search performs the following: Compare X with each element of array one by one If X matches with an element,…
Code Complexity compute it by using the control flow graph of the program. Cyclomatic complexity measures the number of nested conditions within the code, such as those created by for, if/else, switch, while, and until. The greater the number of conditions (as in example b from above), the greater the complexity. Time complexity: Worst…