🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/doojin/sorting

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

github.com/doojin/sorting

v0.0.0-20140831100711-a3ce4c903344
100

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Version published
Created
Issues
0

Go Sorting

Array sorting algorithms implemented in Go

Algorithms implemented:

  • Stupid sorting
  • Bubble sorting
  • Selection sorting
  • Coctail sorting
  • Gnome sorting
  • Insertion sorting
  • Quick sorting
  • Merge sorting
  • Tree sorting

Examples:

package main

import (
	"./sorting"
	"fmt"
)

func main() {
	arr := []int{13, -45, 28, 0, 112, -5}

	result := sorting.BubbleSort(arr)
	fmt.Println(result)

	result = sorting.InsertionSort(arr)
	fmt.Println(result)

	result = sorting.GnomeSort(arr)
	fmt.Println(result)

	result = sorting.TreeSort(arr)
	fmt.Println(result)

	// and others...
}

Output:

[-45 -5 0 13 28 112]
[-45 -5 0 13 28 112]
[-45 -5 0 13 28 112]
[-45 -5 0 13 28 112]

FAQs

Package last updated on 31 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts