private int Compare (int x, int y)
{
return x < y ? x : y;
}
When we comapre two Object value we usually performed boxing and unboxing which create overhead on the Application. We used a collection similarly when value is added to a collection boxing take places when value is retrieved unboxing take places. Collection makes a job easy for boxing and unboxing
private T Compare
{
if (x.CompareTo (y) < 0)
return x;
else
return y;
}
No comments:
Post a Comment