[algogeeks] Re: Jumping Puzzle

2011-08-11 Thread Algo Lover
t; wrote: > > > > > > > > > > > I did not get the optimal solution part..how is that u jump 1 to index 1? > > > On Thu, Aug 11, 2011 at 10:07 AM, Algo Lover wrote: > > >> Given an array, start from the first element and reach the last by > >>

[algogeeks] C doubt

2011-08-11 Thread Algo Lover
Suppose i create a block of 10 ints, p is a pointer pointing to this block. int (*p)[10]; How can i initialize these 10 integer blocks using pointer p. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to alg

[algogeeks] Jumping Puzzle

2011-08-11 Thread Algo Lover
Given an array, start from the first element and reach the last by jumping. The jump length can be at most the value at the current position in the array. Optimum result is when you reach the goal in minimum number of jumps. For ex: Given array A = {2,3,1,1,4} possible ways to reach the end (index

[algogeeks] Re: Amazon Puzzle

2011-08-07 Thread Algo Lover
amazon... > > > > > > > > On Sun, Aug 7, 2011 at 11:29 PM, Algo Lover wrote: > > Two people are travelling through flight. Both have parachute and jump > > anywhere randomly i.e none of them knows who has jumped where.(Assume > > there's a big desert an

[algogeeks] Amazon Puzzle

2011-08-07 Thread Algo Lover
Two people are travelling through flight. Both have parachute and jump anywhere randomly i.e none of them knows who has jumped where.(Assume there's a big desert and they jump at any random location). Now, both of them have a single piece of paper on which they can write instructions before jumping

[algogeeks] Re: Probability Puzzle

2011-08-07 Thread Algo Lover
Can anyone explain the approach how to solve this . I think all tosses are independent so it should be 3/5. why is this in- correct On Aug 7, 10:55 pm, saurabh chhabra wrote: > sry...its wrong > > On Aug 7, 10:34 pm, Algo Lover wrote: > > > > > > > > > A ba

[algogeeks] Probability Puzzle

2011-08-07 Thread Algo Lover
A bag contains 5 coins. Four of them are fair and one has heads on both sides. You randomly pulled one coin from the bag and tossed it 5 times, heads turned up all five times. What is the probability that you toss next time, heads turns up. (All this time you don't know you were tossing a fair coin

[algogeeks] Rotate a 2-D matrix by 90 degree inplace.

2011-08-06 Thread Algo Lover
Can anyone solve this problem without using extra matrix -- 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...@goo

[algogeeks] Intersection of 2 rectangles

2011-08-06 Thread Algo Lover
Given 2 rectangles not necessary parallel to co-ordinate axis. How would you find if the rectangles intersect and if they do find the intersection points -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to alg

[algogeeks] Maximum Difference among Adjacent elements on Number Line

2011-08-06 Thread Algo Lover
given an UNSORTED real number array x1,x2,...,xn, how to find the max distance of two neighbouring numbers in the number axis. Is there any method with O(n) time complexity? see an example given x[]={2.0,1.0,9.0,-3.5} then the answer is 7.0, because on the number axis, it is -3.5,1.0,2.0,9.0 from l