mawingpui
asked on
Enumerable Skip
I have two codes as follow,
Code 1
Code 2
They provide the same result.
If the list contains billion values and filter condition is different, base on the performance which one is better?
Code 1
int[] grades = { 1, 2, 3, 4, 5 };
var q = from c in grades.Skip(1)
select c;
foreach (int number in q)
Console.WriteLine("{0}", number);
Code 2
int[] grades = { 1, 2, 3, 4, 5 };
var q = from c in grades
where c > 1
select c;
foreach (int number in q)
Console.WriteLine("{0}", number);
They provide the same result.
If the list contains billion values and filter condition is different, base on the performance which one is better?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.