I was amazed too, but Idea is about :
--------------
Otherwise: locally rising on some side
• Must be a peak in that direction
• So can throw away rest of array,
leaving a[0-i] or a[i+1-n].
--------------
i'm not sure yet and need to test with a code.


On Sun, Jun 24, 2012 at 9:45 AM, Sourabh Singh <singhsourab...@gmail.com>wrote:

> @Hassan Monfared
>
> was reading that link only. it's strange how he assume's we can leave
> half of element's ??
>
> – If A[n/2-1]>A[n/2]  then search for a peak among A[1]… A[n/2-1] ?? why ??
>
> eg. 12 12 12 11 1 2 5 3
>
> m i missing something ??
>
> On Sat, Jun 23, 2012 at 10:02 PM, Hassan Monfared <hmonfa...@gmail.com>
> wrote:
> > just found a good resource for 1d and 2D version :
> > http://courses.csail.mit.edu/6.006/spring11/lectures/lec02.pdf
> >
> >
> > On Sun, Jun 24, 2012 at 3:31 AM, sengar.mahi <sengar.m...@gmail.com>
> wrote:
> >>
> >> @adarsh :its nt dat easy as u see it..
> >>
> >>
> >> On Sun, Jun 24, 2012 at 1:45 AM, Sourabh Singh <
> singhsourab...@gmail.com>
> >> wrote:
> >>>
> >>> @adarsh kumar
> >>>
> >>> are u sure it's worst case will be O (log n) ??
> >>> i think iff array is fully sorted O(n) will be required to say "NO
> >>> such element present"
> >>>
> >>> On Sat, Jun 23, 2012 at 1:11 PM, adarsh kumar <algog...@gmail.com>
> wrote:
> >>> > This is a variation of binary search, the difference being that we
> have
> >>> > to
> >>> > search for an element that is greater than its immediate left one and
> >>> > lesser
> >>> > than its immediate right one. Just implement binary search with these
> >>> > additional constraints, thereby giving O(log n).
> >>> > In case of any difficulty/error, let me know.
> >>> >
> >>> > On Sun, Jun 24, 2012 at 1:27 AM, Hassan Monfared <
> hmonfa...@gmail.com>
> >>> > wrote:
> >>> >>
> >>> >> Given an array of integers find a peak element of array in log(n)
> >>> >> time.
> >>> >> for example if A={3,4,6,5,10} then peak element is 6  ( 6>5 & 6>4 ).
> >>> >>
> >>> >> Regards.
> >>> >>
> >>> >> --
> >>> >> You received this message because you are subscribed to the Google
> >>> >> Groups
> >>> >> "Algorithm Geeks" group.
> >>> >> To view this discussion on the web visit
> >>> >> https://groups.google.com/d/msg/algogeeks/-/AQI6ahWgyOIJ.
> >>> >> To post to this group, send email to algogeeks@googlegroups.com.
> >>> >> To unsubscribe from this group, send email to
> >>> >> algogeeks+unsubscr...@googlegroups.com.
> >>> >> For more options, visit this group at
> >>> >> http://groups.google.com/group/algogeeks?hl=en.
> >>> >
> >>> >
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> >>> > Groups
> >>> > "Algorithm Geeks" group.
> >>> > To post to this group, send email to algogeeks@googlegroups.com.
> >>> > To unsubscribe from this group, send email to
> >>> > algogeeks+unsubscr...@googlegroups.com.
> >>> > For more options, visit this group at
> >>> > http://groups.google.com/group/algogeeks?hl=en.
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Algorithm Geeks" group.
> >>> To post to this group, send email to algogeeks@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> algogeeks+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/algogeeks?hl=en.
> >>>
> >>
> >>
> >>
> >> --
> >> Regards
> >> Mahendra Pratap Singh Sengar
> >> B-tech 4/4
> >> NIT Warangal.
> >>
> >> Facebook ID
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> algogeeks+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to