job opennings at Incyte# Biology - 生物学
B*1
1 楼
Difference is Minimum
Algorithm to find the two numbers whose difference is minimum among the set
of numbers.
For example the sequence is 5, 13, 7, 0, 10, 20, 1, 15, 4, 19
The algorithm should return min diff = 20-19 = 1.
Constraint - Time Complexity O(N) & Space is not a constraint [upto O(3N)]
Assumption - Sorting O(nlogn) & comparison of adjacent numbers is already
known & is not an option. Try to keep it linear
Algorithm to find the two numbers whose difference is minimum among the set
of numbers.
For example the sequence is 5, 13, 7, 0, 10, 20, 1, 15, 4, 19
The algorithm should return min diff = 20-19 = 1.
Constraint - Time Complexity O(N) & Space is not a constraint [upto O(3N)]
Assumption - Sorting O(nlogn) & comparison of adjacent numbers is already
known & is not an option. Try to keep it linear