Bug Vanquisher

29 June 2007

One day I’ll ask someone

Filed under: Fun — Tanveer Badar @ 11:54 PM

The day will come when I will be sitting across the desk, asking someone interview questions.

In preparation for those far, far-away, distant future days, here is a question I read yesterday.

“An array of ‘n’ items where each cell contains a number from the set [1,n-1] with every number in the set occurring at least once. Since, the set has n-1 members and the array is n item long, one number is duplicated. Give a linear time, constant space algorithm to search for this duplicate number.”

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: