我有一个包含大量日期时间数据的 2 个数组列表。一个数组列表包含 10 万个日期时间,另一个数组列表包含 12 万个日期时间。我想将一个数组列表项与每个项的另一个数组列表进行比较。
例如 :
ArrayList<Calendar> al1 = new ArrayList<Calendar>();//contains 100 thousand datetimes,sorted
ArrayList<Calendar> al2 = new ArrayList<Calendar>();//contains 200 thousand datetimes,sorted
//al1.retainall(1l2); // i have tried this.but its taking too much of time.
// i want to retrieve watever same time from al1 to al2
//so i have used loop,still i am getting too much of time.
有什么办法可以减少比较时间数组列表的时间。有人可以帮我吗?