Asked • 05/24/19

Efficiently finding the intersection of a variable number of sets of strings?

I have a variable number of ArrayList<String>'s that I need to find the intersection of. A realistic cap on the number of sets of strings is probably around 35 but could be more. I don't want any code, just ideas on what could be efficient. I have an implementation that I'm about to start coding but want to hear some other ideas.Currently, just thinking about my solution, it looks like I should have an asymptotic run-time of &#920;(n<sup>2</sup>).Thanks for any help!tshredEdit: To clarify, I really just want to know is there a faster way to do it. Faster than &#920;(n<sup>2</sup>).

2 Answers By Expert Tutors

By:

Kaitlyn R. answered • 05/24/19

Tutor
5.0 (103)

Adjunct Professor in Computer Science

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.