/algo

Implementation of algorithms in go

Primary LanguageGoGNU General Public License v3.0GPL-3.0

Algorithms in Go

Go Report Card GoDoc

Build Status Coverage Status

This repo provides implementation of basic algorithms in go.

Algorithms implemented

Sorting

BenchmarkSortHeap-4                20000             68416 ns/op               0 B/op          0 allocs/op
BenchmarkSortInsertion-4            5000            254319 ns/op               0 B/op          0 allocs/op
BenchmarkSortQuick-4              100000             19747 ns/op               0 B/op          0 allocs/op
BenchmarkSortSelection-4            3000            489689 ns/op               0 B/op          0 allocs/op
BenchmarkSortGo-4                  20000             66971 ns/op              32 B/op          1 allocs/op

Maximum Subarray - Wiki

  • Brute Force
  • Divide, Conquer & Combine (DC)
  • Kadane's Algorithm
BenchmarkSubarrayBruteForce-4                 20          74001950 ns/op               0 B/op          0 allocs/op
BenchmarkSubarrayDC-4                     100000             16306 ns/op               0 B/op          0 allocs/op
BenchmarkSubarrayKadane-4                1000000              1371 ns/op               0 B/op          0 allocs/op

Datastructures

This is a Work in Progress