Dynamic Programming and its Application in Sequential Search