ivanjovanovic/sicp

Potential problem

justinmeiners opened this issue · 1 comments

I don't know if you are looking for feedback or not. If not, ignore this. I have used your answers when I get stuck or am looking for alternative implementations.

(output (intersection-set (list 1 2 3 1 1 7 7) (list 2 3 4 1 1 7)))

What happens when the duplicates are in list b instead of list a? Example;
(intersection-set (list 1 2 3 1 1 7) (list 2 3 4 1 1 7 7))

Hi Justin,

thanks for getting in touch.

Just by looking into it, I assume it returns correct set which is intersection but allows duplicates to be transferred into the intersecting result.

If you are having setup to run the code and check several examples, maybe you can run it and provide proposal for improvement if there is a case where the intersection-set would not give the correct result.

Thanks again,
Ivan