'How to compare each element in one structured list with time complexity less than O(n^2) in java
Suppose I have a structured List Like List<Data> and my Data class is :
class Data {
int Id;
int duration;
}
My List has about 10 million records.
My elements are unique but it is possible for two elements to have same id.
How can I fetch elements with same id that have duration difference?
Which algorithm has less time complexity to return my required elements?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
