in the code given for 2nd ques,
binary_search function is used then why is time complexity linear??
Time complexity in 2nd ques
This is because of the data structure used. In lists you have to travel across elements one by one as direct indexing is not available.
In arrays/vectors the complexity if logN
lists are same as linked lists which we create with the help of pointers?
Yes these are inbuilt version of those!
ohkk thanks a lot for your help sir!