There might be a term for this (list intersection?) but I am not sure so lets open it up a little bit.
I have two lists of integers, A and B. I need a fast way to get two new lists based on the elements in them. One of the new lists should contain all elements found in A but not in B, and the other list should contain all elements found in B but not in A. Since I am not really sure what to call this, I am having a hard time finding good info on it online.
I am looking for a general algorithm or best practice on how to do this sort of thing. If it matters, I am using C# for this. The length of the lists are usually quite small (less than 50 elements) but the algorithm needs to be quick since I need to do it every 10 frames or so.
I can think of a brute force way to do it, but is there anything faster?