Find Minimum Element in a Sorted and Rotated Array | Programming Tutorials

preview_player
Показать описание
Given a sorted array which is rotated any number of times. Write a code to find minimum element in a sorted and rotated array.

In this tutorial, I have explained java code to find minimum element in sorted and rotated array.

Рекомендации по теме
Комментарии
Автор

It is simply like to find min value in array or any different?

ambarishshiva
Автор

nice but if you would have explained start<mid and mid>end conditions would have been greater

deepakanuraagsathyanarayan
Автор

Nice explanation 😍😍.But It works for only distinct element and fails on duplicate elements

suryakantpandey
Автор

hey why did u use start<mid and end>mid. can u please explain

pranavyeleti
Автор

If the array is rotated or sorted the minimum element would be the same I don't get the question

shashankshetty
Автор

When arr={1, 2, 3, 4, 5, 6, 7}
Mid=7/2, mid=4(element)
So end=mid-1=3(element)
So now start=0 (1(
End=3(4)
Mid=0+3/2= 1 i.e 2
Now 1<2 cond 1 is false
Next mid+1> mid --> (4<3) this cond is also false. How to solve

aishwaryameti
Автор

Code link is present in the description box.

ProgrammingTutorialsM