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 8966169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:58:07+00:00 2026-06-15T16:58:07+00:00

I wanted to call the code in the main method, but it seems like

  • 0

I wanted to call the code in the main method, but it seems like it doesn’t really work.

public class RecursiveSelectionSort {

public static void sort(double [] list){


    sort(list, 0, list.length -1);
}
public static void sort(double [] list, int low, int high){
    if (low < high){
        int indexOfMin = low;
        double min = list[low];
        for(int i = low + 1; i <= high; i++){
            if(list[i]< min){
                min = list[i];
                indexOfMin = i;
            }
        }
        list[indexOfMin] = list[low];
        list[low] = min;

        sort(list, low + 1, high);
    }
}
public static void main(String [] args){
    double [] list = {3.0,4.0,1.0};//I tried but it doesn't work
    System.out.print(sort(list));//it doesn't go to sort(list);
}
}

I was wondering if I can call it. It seems easy, but really confusing.

  • 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-06-15T16:58:08+00:00Added an answer on June 15, 2026 at 4:58 pm

    sort is a void method, you can’t print its result. Try sorting first and then printing the list separately.

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

Sidebar

Related Questions

I wanted to call Test1() Method Within WaitAndCallFunc() Function. Code: typedef void (*func)(); void
So I wrote some numerical code in C but wanted to call it from
I have this class file call SMSHelper.cs First I just wanted to know is
Wanted to know if someone had a suggestion on code or maybe there's a
just wanted to ask where I define initial class properties? From other languages I
I wanted to use 6 different textures on a cube, one per side, but
I want to have a simple class i can call to get a unique
As an answer to another question I wanted to post the following code (that
I have written a small piece of code to calculate quadratic equations, but if
This is a learning exercise in expression trees. I have this working code: class

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.