Time_complexity in Q2

As it is using binary search so ans should be D has time comlpexity will be logarithmic of size of list

Hey @akshitagarg15 binary search has time complexity of logn when we are doing it on an array or data structure with contiguous memory, since list has only sequential access which means slow tranversal, it’ll take O(n) for binary search.
accessing the last element in an array is O(1) but accessing the last element in the list is O(n)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.