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

  • SEARCH
  • Home
  • 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 6026283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:25:23+00:00 2026-05-23T04:25:23+00:00

What is the neatest algorithm for that ? Can it be done without helping/static

  • 0

What is the neatest algorithm for that ? Can it be done without helping/static variable ?

  • 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-23T04:25:24+00:00Added an answer on May 23, 2026 at 4:25 am

    Use two “for” loops. Assuming that you don’t need to compare elements against themselves, and you only need to test each pair one way around rather than both ways:

    for (int i = 1; i < ints.length; ++i) {
        for (int j = 0; j < i; ++j) {
            match(ints[i], ints[j]);
        }
    }
    

    If you want all pairs both ways, just change j < i to j < ints.length. If you want pairs both ways, excluding self-comparisons, either add if (i != j) in the inner loop or else do one inner loop from 0 to i-1, and another from i+1 to ints.length.

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

Sidebar

Related Questions

Is anyone aware of a nearest neighbor algorithm implemented in Python that can be
Which algorithm do you recommend to find out the nearest node which can be
Can someone give me a code sample of 2-opt algorithm for traveling salesman problem.
I'm completely new to the k-nearest neighbor classifier algorithm. Can someone please give me
I can use the median of medians selection algorithm to find the median in
Suppose a general sliding algorithm that executes some function on a kernel, like a
using c# visual studio 2008. Can anyone help with an algorithm to do this
Given a set S of points in 2-dimensional space, provide an algorithm that computes
I am interested in the shortest, neatest piece of C# code around that will
What's the quickest/neatest way to calculate the next anniversary of someone's birthday. For example,

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.