I've got a algoritmical problem:
- table tableA with objects Point(id, x, y)
- table tableB with objects AA(numberOfPoints, pointID)
and I need method which returns table with Points, which were in at least two AA objects.
I can do it using for-loops. I can iterate over tableA, next - over tableB, and over table pointId table. But using this way this algorithm will have complexity n^3 (cubic). It's very bad.
Do you have any other better idea how to do it? What structure should I use?