Comparing two collections for equality


/ Published in: C#
Save to your folder(s)

This algorithm is O(N*logN)


Copy this code and paste it in your HTML
  1. bool equal = oldList.OrderBy(i => i).SequenceEqual(newList.OrderBy(i => i));

URL: http://stackoverflow.com/questions/50098/comparing-two-collections-for-equality

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.