Code Posted at ->

Working Java code for each of these puzzles available at http://datastructure-puzzles-codesolutions.blogspot.com


Code Downloads from github https://github.com/inders/datastructure-repo

Saturday, July 24, 2010

An Ant Antic

A 5 feel pole is so place that its ends rest on 2 buckets , one filled with sugar and the other with cream. Some ants are dropped randomly(wrt the point of drop) on the pole and they start running towards the left or right directions. If 2 ants hit each other they reverse their direction instantaneously and start moving again. If an ant reaches the either end of the pole it jumps into the bucket at that end to bask in heavenly sweetness.

If they travel at 1 inch/second how long will it take for all ants to fall off ?

13 comments:

hritupon said...

:) does not matter whether they reverse when they collide or just cross over each other. So if we replace the situation saying that the ants cross over each other when they collide ..what will be the answer....????

李蔡文山家榮 said...

未來屬於那些相信他們美好夢想的人。.......................................................

怡于名君 said...

不會從失敗中找尋教訓的人,成功之路是遙遠的。.................................................

家唐銘 said...

過去的事早已消失,未來的事更渺不可知,只有現在是真實的................................................

韋陳富 said...

人生有如洶湧的波濤,如果沒有岩石的阻擋,怎能激起美麗的浪花?......................................................

筱陳婷 said...

在你一無所有的時候 是誰在陪伴你 他便是你最重要的人......................................................................

淑梁梁梁娟 said...

要經常發表文章 最愛你了呦...............................................................

張王雅竹欣虹 said...

想跟你說一聲加油,祝福大家每天開心............................................................

秋協盛協盛昀 said...

上班好累哦,看看部落格轉換心情~~~先謝謝啦!!............................................................

佳張張張張燕張張張張張 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................

8468 said...

很不賴的分享!! 多謝啦!!◑0◐......................................................

黃英吳思潔吳思潔邦 said...

精彩的部落格 值得一推再推 支持你......................................................

tenax_technologies said...

Custom software is the most expensive type of development due to it’s nature - unique functionality and utilization of new challenging technologies. The most important thing to understand is that java software development outsourcing is a significant decision that can have lasting ramifications for an organization