Algorithm ideas for a problem

Правка en1, от 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский prakhar897 2018-12-08 21:24:19 380 Initial revision (published)