How would you pick the middle element of a list
Anonymous
its a list (assuming not an array).... Take two pointer....increment 1st pointer by 2 everytime & second by 1 [Rabbit & tortoise problem] if 1st pointer(rabbit) reaches the end of the list.... the position of the tortoise is the location of the middle element of the list.
Check out your Company Bowl for anonymous work chats.