534 is the correct answer
On Fri, May 20, 2011 at 8:47 AM, Bhavesh agrawal agr.bhav...@gmail.comwrote:
1 elephant can take 1000 banana at a time and eat 1 banana after each 1km
travel.
total bananas are 3000 and distance have to travel from A to B is 1000km.
So how many max bananas he can
Hello,
I guess
http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/
will help you to understand better. Basically the output will depend
on endianess of the system. I guess your machine were you ran this
program is little endiness machine. Let me know if
@immanuel...i don't think it will..even if u think it does, provide
any sample test case
On 5/21/11, immanuel kingston kingston.imman...@gmail.com wrote:
I think your soln will print repetitions also.
On Mon, May 16, 2011 at 2:34 PM, Piyush Sinha
ecstasy.piy...@gmail.comwrote:
*int
@Amit JaspalThe algo given by me works for the given case..check it
On 5/20/11, Anurag Bhatia abhati...@gmail.com wrote:
Just need some clarification; sorry I joined the thread late. What are we
trying maximize? A[j] -A[i] such that ij? or j-i such that A[i]A[j]?
--Anurag
On Fri,
everyone ,plz post some solution or explanation..
--
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
if i am in saraswati river then it will be ok as water level is hard to
swim
--
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
saraswati river has gone extinct
On 5/21/11, Bhavesh agrawal agr.bhav...@gmail.com wrote:
if i am in saraswati river then it will be ok as water level is hard to
swim
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
Solution:
int majorityElement(int a[], int n) {
if (a == null || a.length == 0 || n=0) return -1;
int mElement = a[0];
int count=1;
for (int i=1; i n; i++) {
if (a[i] == mElement) {
count++;
} else {
count--;
}
if (count =
Hi, can someone give an algorithm to directly convert a number in a given
base to a number in another base, without converting it into some another
intermediate base.
I have done that using some numerical analysis techniues, but dont remember
now.
Thanks in advance.
--
You received this
http://mycsinterviewsexperiences.blogspot.com/
--
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
@all you can find the better explanation here , hope it will help
http://ashutosh7s.blogspot.com/2011/02/camel-and-banana.html
feel free to comment if anything wrong
Thanks
Shashank Mani Best Way to Escape From Problem is to Solve It
CSE,BIT Mesra
--
You received this message because you
*Hi*
*
*
*Puzzle Digest Of The Week 16May - 20May*
*
*
*
http://dailybrainteaser.blogspot.com/2011/05/logic-riddle-20-may.html?lavesh=lavesh
*
*
*
*
http://dailybrainteaser.blogspot.com/2011/05/is-this-maths-riddle-19-may.html
?**lavesh=lavesh*
*
*
*
Which data structure is the most efficient to store and access movie
shots.
Say, when a movie song is shot, it may include 5 scenes from
Switzerland,8 from malaysia, 6 from india etc. and these various
scenes shot will be sequenced in the movie song in a random order.
Example:
When the movie song
@Saurabh: Implement a long division algorithm using the original base.
Divide the number by the second base. Convert the remainder to a
single digit in the new base. This is the low-order digit. Apply this
divide and convert algorithm to the successive quotients to get the
successive digits.
Dave
@All: The difference between the camel-and-banana problem and this one
is that the elephant eats the banana _after_ he has gone the km. As in
the camel explanation, he establishes a cache of bananas at 200 km.
This takes 5 one-way trips of 200 km, so he eats 1,000 bananas, and
has 2,000 bananas at
Not strictly an algorithmic question, rather a test-of-design-skills type of
question.
You are asked to design a 3-in-1 remote control for TV, a DVD player, and a
cable box.
How will you go with design ?
In my approach it should have following buttons.
1) *Device Key* :
Will represent device
1) go to 1000/3 with 1000 babanas, reserves 1000/3 at 1000/3 position
2) same as 1)
now there are 2000/3 bananas at 1000/3 position.
3) go to 1000/3 position with 1000 babanas, then there are (2000/3 +
1000 - 1000/3) = 4000/3 babanas
4) go to (1000/3 + (4000/3 -1000)/3) = 4000/9 position with
@Anders: First cache should be 2,000 bananas at 200 km. Then you can
get 534 bananas to the destination as I explained in
http://groups.google.com/group/algogeeks/msg/6ff5e9ca52f4b5d6.
Dave
On May 21, 10:58 am, Anders Ma xuejiao...@gmail.com wrote:
1) go to 1000/3 with 1000 babanas, reserves
*Japanese Universities
All classes are offered in English. 30-100% tuition reduction offered.
http://bit.ly/khS0GB
Study Online For Diploma
Study at Your Own Time Own Pace Globally Recognized Diploma Courses
http://bit.ly/khS0GB
*
--
If you would like to get daily pictures
We've started a Google
19 matches
Mail list logo