Min in a circular list

You are given a list of numbers. When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum # in this list. Find any given # in the list. The numbers in the list are always increasing but you don’t know where the circular list begins

Comments

  1. continue till you find that the next number is smaller than your current number. The next number is the smallest and the current is the largest. :)

    ReplyDelete

Post a Comment

Popular posts from this blog