can we not just find index of min element and pivot element will be at the previous index
Binary Search: Pivot Element
Hey Pritika, can you please mention the problem’s exact name which you are talking about.
Hi Pritika,
you can do so, but then time complexity will be O(n) and not O(log n)
using binary search you reduce the time complexity.
Linear search O(n)
Binary Search O(log n)
Hit like if you get it!
Cheers
1 Like