I have a list of point object where point class has two properties X and Y. So I have a object which looks like this
{1,2}
{2,3}
{3,4} so here in the above elements as you see the X value is increasing from 1-2-3 so I need a method which returns TRUE for this.
if I have a other object say
{1,2}
{3,2}
{2,1} here X is not increasing nor decreasing sequentially and hence the method should return false as X goes from 1-3-2.
Can I achieve this in LINQ or what would be the better way
You haven’t indicated how consecutive points with equal values of X should be treated. Assuming you consider {1,…},{2,…},{2,…},{3,…} a match, you can write this:
If they must be strictly increasing, use
<instead<=.