It's this kind of bubble? How can I test it?

Hi all
Someone please confirm that this code snippet uses the bubble sort algorithm to sort the array it receives? Moreover, would there be a difference in functionality, efficiency or otherwise if I rewrote the same method using recursion? Also, I'd appreciate it if someone could suggest some test cases to test this code, I don't know how I can go about this.

Thank you very much.
public static void sort (float array[]){
        int mIndex = 0;
        float temp;
        int i = 0, j = 0;

        for (i=array.length-1; i>0; i--){
            mIndex = i;
            for (j=0; j<i; j++){
                if (array[j] > array[mIndex]){
                    mIndex = j;
                }
            }
            if (mIndex != i){
                temp = array;
array[i] = array[mIndex];
array[mIndex] = temp;
}
}
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Moon123 wrote:
Thank you very much for your help. I'll test it as suggested as well.

Wouldn't it be better if you took instead what you learned here and transmitted to your friend? His work for her is not helping. Helping means teach him how to do this kind of things itself.

Tags: Java

Similar Questions

  • Is the difference between TSMC and Samsung Chip in the real Iphone 6 s? If this is the case, how can I found it before buying a new? How can I

    Is the difference between TSMC and samsung chip processors in the real Iphone 6 s? If this is the case, how can I found it before buying a new one?

    No, it isn't.

  • just bought this mac book. How can I get my music and photos on this camera

    I just bought this mac book. How can I get my music library and photo in this device

    Connect the computers with an Ethernet cable and open Applications > utilities > Migration Wizard on both machines and run it.

  • I try to delete a file, but its duration I can't find this particular run file.how can I find this .exe files

    original title: delete files problem
    I try to delete a file, but its duration I can't find this particular run file.how can I find this .exe files

    I try to delete a file, but its duration I can't find this particular run file.how can I find this .exe files

    You mean you tried to delete a file, but said that it was in use?

    Try Unlocker.

  • Adobe Creative Cloud is full of photos would like to delete, but this does not work, how can I do?  Wim

    Hoi

    Adobe Creative Cloud is full of photos would like to delete, but this does not work, how can I do?

    Thanks Wim

    Move this thread for: Adobe Creative Cloud

  • How can I test updates to a folio in a multi-folio without affecting the direct application?

    Earlier this year, we have created a multi-folio for a client application and it is available in the app store. We are working on the updating of a folio in the multi folio and have difficulties to test updates before they go live.

    We have transferred the files through Folio Builder under the same ID as the original folio was built. According to ng.html https://helpx.adobe.com/digital-publishing-suite/kb/errors-incomplete-publishing-or-updati (Solution 2), we have updated the folio in Folio Producer with the status of soldier to test the updates before going live. A private time has been selected, the folio direct since the app store was removed from our iPad and was no longer available for download. Once we went into producer Folio and changed from private to public, it instantly shows up on our iPad.

    Once the revised files are uploaded through Folio Builder, we can connect to Adobe Content Viewer to review updates but the content viewer is not always a perfect finished product representation (ex: videos).

    My question is: How can I test updates to a folio in a multi-folio without affecting the direct application?

    We have an application multi-folio as well and we test in the Adobe Content Viewer application. You can either sign with your publishing Adobe ID and it will appear or share the folio in InDesign with a different Adobe ID if you prefer.

  • HTTPService with XML format errors when XML is empty. How can I test the value?

    I have a simple HTTPService that returns XML code. 99% of the time there are values and all is right with the world, but sometimes there is no values and my xml looks like this

    <?xml version="1.0" encoding="UTF-8" ?> 
      <node /> 
    
    

    It is quite valid. How can I test this and avoid

    ReferenceError: Error #1069: node not found property on flash.xml.XMLNode and there is no default value.

    I tried

    If

    Normally the XML with the look as values

    (event.result.node == null)

    <node>
    -     <node label="MYLABEL1" id="231" type="O" />
          <node label="MYLABEL2" id="263" type="O" />
      </node>
    
    
    
    

    This Punch and see what happens:

    var xml =

    ;

    If (xml.hasOwnProperty ("node"))

    {

    trace ("neat!");

    }

    var xmlList1:XMLList = xml.node.attribute ("attribute1");

    If (xmlList1.length () > 0)

    {

    trace ("attribute1 found.');

    }

    var xmlList3:XMLList = xml.node.attribute ("attribute3");

    If (xmlList3.length () > 0)

    {

    trace ("attribut3 found!'); This will not be found

    }

    Of course, the try-catch blocks are my usual method of getting XML incorrect, but it's a little hokey.

  • How can I test the Boolean State of the button action?

    Hello
    in as2.0, how can I test the Boolean value if a key has been pressed or not?

    I have a function simple im trying to work with like that...

    button_btn.onRelease = function (success: Boolean) {}
    If (success) {}
    trace ("we pressed the button value is true");
    }
    else {}
    trace ("value is false");
    }
    };

    working with Boolean values in this way is new to me - pointers will do - thanks!

    I got it! Here's a quick run down in a table format, hehe

    cry [0]...
    [1] create a Boolean variable
    [2] create your switch case statements correctly //which I have...
    [3] condition your Boolean in case statements
    [4] and then create your button managers
    [5] if the Boolean value is true, then say stream_ns.seek (0)
    [6] happy!

    Thanks again K - have a nice day.

  • This computer is old; How can I stop messages from "update of the plugin"?

    This computer is running Mac OS 10.4.11 on a Power PC chip. I get a small window at the top of the screen that says: "some plugins used by this page are out of date. The problem is that this old computer won't accept any of the proposed new plugins (Flash, QuickTime, Java, etc.). How can I stop the message from popping up?

    Enter ' subject: config "in the address bar of the browser, confirm the information dialog box, then find the preference named"plugins.hide_infobar_for_outdated_plugin"and double click it to switch to 'true '.

    Please note that firefox won't also support architecture ppc any longer, however if you want to use an updated firefox-based browser, you can switch to "tenfourfox" - Firefox no longer works with the processors in Mac OS X 10.4 or PowerPC

  • I've removed this program, realtek GBE, how can I get it back?

    I've removed this program, realtek GbE, utility of atheros customer and dell 5530 broadband wireless for my laptop, how can I get it back?

    I've removed this program, realtek GbE, utility of atheros customer and dell 5530 broadband wireless for my laptop, how can I get it back?

    Install it to leave media provided by the manufacturer and/or download from the web site of the manufacturer and install it.

    You will probably have to do that since another machine because you deleted your wired network devices and wireless - it seems.  Then copy it to the original machine.

    (You want wired network device drivers and wireless for your Dell system on the site of sale Support and driver downloads for your particular model Dell system (you can simply use your serial number.)

  • 8007371 C error code. This is what and how can I solve this problem?

    For these last two days I tried to update my Windows Vista, but the updates that I tired failed and show this error code on this subject. What this mean and how can I solve this problem? Thank you.

    Hello

    1. do you have security software installed on the computer?

    2 did you last modified the software on the computer?

    3. do you have active user account control?

    Method 1:

    I suggest to turn off user account control and also disable any anti-virus application and then try to install the updates.

    Enable or disable the User Account Control

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-user-account-control-on-or-off

    Warning: User Account Control (UAC) can help you to prevent your computer from unauthorized changes. It works by asking permission when a task requires administrative rights, such as installing software or changing settings affecting other users. We do not recommend disable user account control. If you turn it off, you must reactivate as soon as possible.

    Disable the anti-virus software

    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software

    NOTE: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    If the steps do not help, go to the method 2:

    Method 2:

    I suggest you run the FIXIT from the link below and.

    The problem with Microsoft Windows Update is not working

    http://support.Microsoft.com/mats/windows_update/

    Method 3:

    You can also try the steps mentioned in the link and check if the two steps above do not work.

    Cannot install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2

    http://support.Microsoft.com/kb/2509997

    Hope this helps and keep us informed if you need help.

  • When I press the SHIFT key to get to register this happened @: M and when I press on enter key this happens #__nb so how can I change the setting I tried to format it but it's always the Sammy _ same__Regards

    When I press the SHIFT key to get to register this happened @: M and when I press on enter key this comes up #.
    NB so how can I change the setting, I tried formatting but it's always the same
    Cordially Sammy

    Try another keyboard, if that solves your problem is faulty and should be replaced.

    "sammy06forever" wrote in the new message: * e-mail address is removed from the privacy... *

    When I press the SHIFT key to get to register this happened @: M and when I press on enter key this comes up #.
    NB so how can I change the setting, I tried formatting but it's always the same
    Cordially Sammy

  • With this new system drive how can DC, I retrieve pages?

    How can I extract a few pages to create a new file? It was easy enough, before I had this CD player.

    Adobe Reader could never extract pages from a PDF; you need to use Acrobat for that.

    If you have done before you (or you) have installed Acrobat?  What version?

  • I don't have the bookmark this page option. How can I get that back?

    I wanted to bookmark a page only to find the option to bookmark has disappeared. How can I get that back?

    Hello John531, in the new default layout there should be a bookmark-star button on your toolbar: learn more about the design of the new Firefox version 29

  • My list of carefully arranged search engines started back in alphabetical order, not after each reboot, but irregularly. No idea why this is happening and how can I stop it please?

    This started to happen out of the blue, not after the installation of a new add-on, nor change any settings that I can remember.

    You can (re) order yourself if you click the icon to search on the search bar engine and manage search engine opens.

    Which can happen if the database search.sqlite file was deleted and then recreated.

    You can make a backup copy of this file.

    Then you can restore it when it happens.

    Do you have a cleaning running software that could be the cause?

Maybe you are looking for

  • A reversal of liquid causes a shift?

    I spilled coffee in my macbook and I took it in the Apple store and they told me that there was no sign of liquid damage, but there is a lag, which, they think, might have been caused by the spill of liquid? How can this be? Can someone explain this

  • Firefox bar tabs at the top this problems

    Hello At the present time, my browser is formatted such that the tabbar is on top. It works fine but there is a small gap of a few pixels from the top of my screen to the top of the tab. This results in not being able to move my mouse to the top of t

  • XWNB5201 installed and working, except...

    I picked up the Powerline 500 + Wifi and installed. Works very well. TV connects and broadcasts, without issue. The problem I have is with my iPhone/iPad. Connected without problem. But as soon as I try to use whatever this either on the phone via wi

  • Re: CD device does not open on the Satellite a series

    Hay @ all.I posted a question about a week ago. I have change my Vista to XP.Now, I have another problem. I don't know but I had to install all the drivers graphic, sound ect. After installing XP. Then after that my bios updated my CD device no longe

  • Satellite L300-15V - the system can not install wireless LAN driver

    After you have installed all the drivers for this machine, the system shows that you need to install the wireless LAN driver, but I did! What is going on? Help! I can't make wireless net home!