Given a number, how to find a closest number in a series of floating point data.
Anonymous
Use a Binary Tree data structure. It is sorted while it stores the elements. Then traverse the tree. Search is log N. In Java there is a ceiling and floor function which does a BFS traversal and tries to search the closest number rounded off, to the nearest below or above number on the basis of ceiling or Floor function.
Check out your Company Bowl for anonymous work chats.