Algorithm ideas for a problem

Revision en1, by prakhar897, 2018-12-08 21:24:19

There are n cities in a circle and distance between every adjacent pair of cities was given. We were asked to determine a pair of cities such that the minimum distance to travel between them is maximum.

For example,the input may be: 8 12 16 10 3 13.

We can definitely solve this in O(n2) complexity.Can we improve the complexity any further?how?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English prakhar897 2018-12-08 21:24:19 380 Initial revision (published)