in Interview Questions
466 views
2 votes
2 votes
#IITD_2011 A man is standing in front of an infinite wall with a hole on any side? How do u find the hole in shortest distance
in Interview Questions
466 views

1 Answer

0 votes
0 votes

A POSSIBLE SOLUTION - Go left and then right of a starting point and increase the distance exponentially i.e. 1km left then 1 km right ..next time increase distance 2 km left and then 2km right.

2 Comments

So, what will be the time complexity?
0
0

If 'n' denotes the shortest distance ,time complexity will be O(2n).

PS:A KM movement is taken as a unit of operation.

0
0

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true