inversions

package
v0.0.0-...-b6b1d6e Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeSortWithInversions

func MergeSortWithInversions(arr []int) ([]int, int)

MergeSortWithInversions returns the sorted array (using MergeSort), and the number of inversions it finds in an []int Example: [1, 5, 2, 4, 3], would have the following inversions: (5, 2), (5, 4), (5, 3), (4, 3), and hence return 4.

Types

This section is empty.

Jump to

Keyboard shortcuts

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