TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deer Park
NA
39
0
Excluding value on one list from other list-Taking too long
Dec 2 2012 2:32 PM
So, I have two list of int array.
Say result1 and result2. I am using the code as follow which will exclude all the items that are in result2 from result1.
But it's talking too much time, since I have thousands of item on both list of int array. Is there any other approach with which I can achieve same efficiently? Appreciated!!
List<int[]> result1 = new List<int[]> { new int[] { 1, 2, 3 }, new int[] { 4, 5, 6 } };
List<int[]> result2 = new List<int[]> { new int[] { 1, 2, 3 }, new int[] { 7, 8, 9 } };
result2.ForEach(t => result1.RemoveAll(z => z.OrderBy(k=>k).SequenceEqual(t.OrderBy(k=>k))));
Reply
Answers (
8
)
C# change executable to dll file
Filling a combobox from another forms.