Skip to content

Chapter 7.4: Selection sort definition fix #1103

@zhytkovd

Description

@zhytkovd

According to the book's definition, selection sort always looks for the largest value; however, examples show an alternative version of selection sort, where we search for the minimum value and place it in the correct spot. To reduce confusion, we can change the definition of the selection sort to include both the minimum and the maximum number versions.

The selection sort improves on the bubble sort by making only one exchange for every pass through the first part of the vector. We will call this a step. In order to do this, a selection sort looks for the largest value as it makes a partial pass and, after completing the partial pass, places it in the proper location, ending the step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions