Need a code which will insert a new element in the Sorted Linked List using Binary Search.The code must be only in C++ please
Last edited on
> Sorted Linked List using Binary Search.
O( log N ) binary search requires a sequence that provides random access in constant time.
std::lower_bound() is O(N) (it does a linear search) if the iterator is not a RandomAccessIterator.