Search:

Type: Posts; User: Freaky Chris

Search: Search took 0.08 seconds.

  1. Replies
    5
    Views
    2,284

    Re: Selection Sorting

    ok ill explain it in words for you.

    set min to first value in array.
    loop through, if a number is less than min set min to that number
    at the end of the array swap the first element in the array...
  2. Replies
    5
    Views
    2,284

    Re: Selection Sorting

    void selectionSort(int[] a) {
    for (int i = 0; i < a.length - 1; i++) {
    int min = i;
    for (int j = i + 1; j < a.length; j++) {
    if (a[j] < a[min]) {
    ...
Results 1 to 2 of 2