Suppose we have a set of $n$ values. There are always at least one negative value and at least one positive value in the set.
What is the worst case time complexity to find FIRST negative value of set?
- If values are stored in an array and arranged in ascending order then it takes $\theta(n)$ in worst case.
- If values are stored in an array and arranged in descending order then it takes $\theta(n)$ in worst case.
- If values are stored in a linked list (only head is known)and arranged in ascending order then it takes $\theta(n)$ in worst case.
- If values are stored in a linked list (only head is known) and arranged in descending order then it takes $\theta(n)$ in worst case.