sorting

package
v0.0.0-...-118f76d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 2 Imported by: 0

README

Sorting

Here are different sorting algorithms described in Chapter 2 of the book.

https://algs4.cs.princeton.edu/20sorting/

Documentation

Index

Constants

View Source
const QuickToInsertionCutoff = 11

QuickToInsertionCutoff defines threshold when quick sort is switched to insertion sort.

Variables

This section is empty.

Functions

func Heap

func Heap(target sort.Interface)

Heap sorts using *Heap sort* algorithm. https://algs4.cs.princeton.edu/24pq/

func Insertion

func Insertion(target sort.Interface)

Insertion sorts using *Insertion sort* algorithm. https://algs4.cs.princeton.edu/21elementary/

func KeyIndexedCounting

func KeyIndexedCounting(keys []int, keyBound int, positions []int)

KeyIndexedCounting sorts by positive integer keys in ascending order. Accepts array of keys, maximum key value and array which will be filled with sorted positions.

func Quick

func Quick(target sort.Interface)

Quick sorts using *Quick sort* algorithm. https://algs4.cs.princeton.edu/23quicksort/

func Shell

func Shell(target sort.Interface)

Shell sorts using *Shell sort* algorithm. https://algs4.cs.princeton.edu/21elementary/

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL