Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:28:16+00:00 2026-05-27T10:28:16+00:00

I have a list of point object where point class has two properties X

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:28:17+00:00Added an answer on May 27, 2026 at 10:28 am

    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:

    Enumerable.Range(0, list.Count - 1).All(i => list[i].X <= list[i + 1].X)
    

    If they must be strictly increasing, use < instead <=.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18 I have a list of array with
I have a list of Point objects, (each one with x,y properties) and would
Does anyone know of a class in Java that has a list of elements,
Hi I work with netbeans. I have written a code which has two classes
I have custom List which has image field. I have to display the image
I have a class object that stores some properties that are lists of other
In a simplified situation like this one, with 3 classes: class ClassONE{ protected List<IntermediatedClass>;
I've written a class that has a list as a variable. I have a
I have some JSON data that looks like this: { data: [{ name:John Smith,
I have a List<ColumnList> ColumnListLists which has a binding source (bsLists) attached to it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.