Algorithms: github.com/minaandrawos/Algorithms

Command Algorithms

Binary search implementation in Go

Insertion sort implementation in Go

Selection sort implementation in Go

String combinations in Go

This is an exercise of recursion typically covered in programming training books:
PROBLEM: Implement a function that prints all possible combinations of the
characters in a string. These combinations range in length from one to the length
of the string. Two combinations that differ only in ordering of their characters are
the same combination. In other words, “12” and “31” are different combinations
from the input string “123”, but “21” is the same as “12”.

String permutations in Go
This is an exercise in recursion encountered in programming training books:

PROBLEM: Implement a routine that prints all possible orderings of the characters
in a string. In other words, print all permutations that use all the characters from
the original string. For example, given the string “hat”, your function should print
the strings “tha”, “aht”, “tah”, “ath”, “hta”, and “hat”. Treat each character in the
input string as a distinct character, even if it is repeated. Given the string “aaa”,
your routine should print “aaa” six times. You may print the permutations in any
order you choose.

Given an unsorted array, count the longest occuring sequence in the array. In the example below, the count is 4 => 1,2,3,4
This algorithm builds a graph then counts the longest branch, it runs in O(N) time

A collection of algorithms implemented in Go

This algorithms can retrieve the minimum k elements of an array, it runs at O(KN) time.

Find all the permutations of a string that has duplicate characters, ensure that no permutation is repeated twice

Package Files¶

Package main imports 2 packages (graph). Updated 2018-01-18. Refresh now. Tools for package owners.