why it’s Linear, it should be of Logarithmic.
Time complexity is Linear in size of the list?
Hey @immanishbainsla 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)
Got it, Thanks. @keshav