Skip to content

ShellSort Wrong #1224

@XmchxUp

Description

@XmchxUp

I tried your code, find error.
Please check it your code.

I think so this. (My english is bad,Sorry. I'm studying hard.)

      for (int i = gap; i < length; i++) {
            int j;
            T temp = array[i];
            for (j = i; j >= gap && less(temp, array[j - gap]); j -= gap) {
                array[j] = array[j - gap];
            }
            array[j] = temp;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions