Re: [algogeeks] Local Minima in Unsorted Array

2012-08-09 Thread Abhishek Sharma
http://courses.csail.mit.edu/6.006/spring11/lectures/lec02.pdf On Mon, Aug 6, 2012 at 12:19 AM, dheeraj chawla dheeraj.chawla...@gmail.com wrote: hello guys, check this code n tell me if i m worng int localminima(int a[],int start,int end) {int mid; while(startend) {

Re: [algogeeks] Local Minima in Unsorted Array

2012-08-05 Thread payal gupta
this could help although not true for many cases as said above http://ideone.com/w5gjK On Sun, Aug 5, 2012 at 8:40 AM, Ashish Goel ashg...@gmail.com wrote: can you give an example of what do you mean by Local minima? From Dave's example, it looks like the minima of the whole array.. Best

Re: [algogeeks] Local Minima in Unsorted Array

2012-08-05 Thread dheeraj chawla
hello guys, check this code n tell me if i m worng int localminima(int a[],int start,int end) {int mid; while(startend) { mid=(start+end)/2; if(a[start]a[start+1]) return(1); else if(a[end-1]a[end]) return(1); else if(a[mid]a[mid+1]) end=mid-1;

Re: [algogeeks] Local Minima in Unsorted Array

2012-08-04 Thread Ashish Goel
can you give an example of what do you mean by Local minima? From Dave's example, it looks like the minima of the whole array.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Aug 3, 2012 at 10:32 PM, shady sinv...@gmail.com wrote: Hi, Can

[algogeeks] Local Minima in Unsorted Array

2012-08-03 Thread shady
Hi, Can anyone tell how to find local minima in an unsorted array ? Recommended solution : O(log(n)) Shady. -- 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

Re: [algogeeks] Local Minima in Unsorted Array

2012-08-03 Thread Suryabhan Singh
u can use heap sort On Fri, Aug 3, 2012 at 10:32 PM, shady sinv...@gmail.com wrote: Hi, Can anyone tell how to find local minima in an unsorted array ? Recommended solution : O(log(n)) Shady. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks