How to find number in a sorted array whose absolute difference from given 'X' is maximum in less than O(N) time?

前端 未结 0 1360

So Let\'s take an example like {8,8,8,8,9,9,9,9,10,12} and given X = 4. so I want to return 12 as its difference from 4 (12-4 = 8) is maximum. I can only think of a linear w

相关标签:
回答
  • 消灭零回复
提交回复
热议问题