algoritmical problem with table

I've got a algoritmical problem:

I've got:

- 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?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!