Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/0xAX/go-algorithms
/ functions
Functions
86 in github.com/0xAX/go-algorithms
⨍
Functions
86
◇
Types & classes
12
↓ 6 callers
Function
Insert
(value interface{}, list *List)
list/list.go:25
↓ 5 callers
Method
Enqueue
Puts a given item into Queue
queue/queue.go:50
↓ 5 callers
Method
Push
Pushes a given item into Stack
stack/stack.go:23
↓ 4 callers
Function
FastPow
O(log n) function for pow(x, y)
numerical/fast_pow.go:4
↓ 4 callers
Method
Insert
(value interface{})
binaryTree/binaryTree.go:34
↓ 4 callers
Function
New
(compareFun Comparable)
binaryTree/binaryTree.go:12
↓ 4 callers
Function
factorial
(num int)
numerical/factorial.go:3
↓ 3 callers
Function
BinPow
BinPow evaluates (base ^ deg) % rem
numerical/bin_pow.go:4
↓ 3 callers
Function
GCD
GCD returns gcd of x and y
numerical/gcd.go:4
↓ 3 callers
Method
Min
()
binaryTree/binaryTree.go:55
↓ 3 callers
Function
fibo
using recursion
numerical/fibonacci.go:4
↓ 2 callers
Method
First
()
list/list.go:44
↓ 2 callers
Function
Has
(value interface{}, list *List)
list/list.go:60
↓ 2 callers
Function
Length
(list *List)
list/list.go:117
↓ 2 callers
Function
Max
* O(n) solution for calculating maximum subarray sum. */
numerical/max_sub_array.go:8
↓ 2 callers
Function
PrimesUpTo
PrimesUpTo finds all prime numbers from 1 to upperBound It's implemented using eratosthenes sieve Works in O(upperBound) time and space
numerical/prime_finder.go:6
↓ 2 callers
Method
Search
(value interface{})
binaryTree/binaryTree.go:19
↓ 2 callers
Function
maxSubarray
(array []int)
numerical/max_sub_array.go:15
↓ 2 callers
Function
sift
* * Heap sort - https://en.wikipedia.org/wiki/Heapsort */
sorting/heap_sort.go:7
↓ 2 callers
Function
swap
(x, y *int)
numerical/swap.go:5
↓ 1 callers
Method
Dequeue
Extracts first item from the Queue
queue/queue.go:65
↓ 1 callers
Method
Last
()
list/list.go:48
↓ 1 callers
Method
Max
()
binaryTree/binaryTree.go:48
↓ 1 callers
Function
Merge
* * Merge sort - http://en.wikipedia.org/wiki/Merge_sort */
sorting/merge_sort.go:7
↓ 1 callers
Function
New
Initialzes new Stack
stack/stack.go:15
↓ 1 callers
Function
New
Initializes new Queue and return it
queue/queue.go:41
↓ 1 callers
Function
New
()
list/list.go:19
↓ 1 callers
Method
Pop
Deletes top of a stack and return it
stack/stack.go:29
↓ 1 callers
Function
Remove
(value interface{}, list *List)
list/list.go:81
↓ 1 callers
Function
arrayEquals
(a, b []int)
numerical/prime_finder_test.go:5
↓ 1 callers
Function
breadthFirstSearch
(start, end int, nodes []int, edges [][]bool)
searching/breadthFirstSearch.go:23
↓ 1 callers
Function
dfs
(start, end int, nodes []int, edges [][]bool)
searching/depthFirstSearch.go:23
↓ 1 callers
Function
floydWarshall
(g [][]graph)
graph/shortest_distance_fw.go:16
↓ 1 callers
Function
getIdx
(target int, nodes []int)
searching/breadthFirstSearch.go:5
↓ 1 callers
Function
getIdx
(target int, nodes []int)
searching/depthFirstSearch.go:5
↓ 1 callers
Function
getK
* * Counting sort - https://en.wikipedia.org/wiki/Counting_sort */
sorting/counting_sort.go:7
↓ 1 callers
Function
inorderCopy
inorder traversal algorithm Copies the elements of the bst to the array in sorted order
sorting/treesort.go:37
↓ 1 callers
Function
insert
insert nodes into a binary search tree
sorting/treesort.go:23
↓ 1 callers
Function
jumpSearch
(arr []int, key int)
searching/jumpSearch.go:5
↓ 1 callers
Function
newNode
allocating a new node
sorting/treesort.go:18
↓ 1 callers
Function
notExist
(target int, slice []int)
searching/breadthFirstSearch.go:14
↓ 1 callers
Function
notExist
(target int, slice []int)
searching/depthFirstSearch.go:14
↓ 1 callers
Function
radixsort
(data []int32)
sorting/radix_sort.go:20
↓ 1 callers
Function
search
(arr []int, key int)
searching/linearSearch.go:4
↓ 1 callers
Function
treesort
(array []int, tree *btree)
sorting/treesort.go:46
Function
BenchmarkSort
(b *testing.B)
sorting/sort_test.go:40
Function
BubbleSort
* * Bubble sort - http://en.wikipedia.org/wiki/Bubble_sort */
sorting/bubble_sort.go:7
Function
CocktailSort
* * Cocktail sort - https://en.wikipedia.org/wiki/Cocktail_sort */
sorting/cocktail_sort.go:7
Function
CombSort
* * Comb sort - https://en.wikipedia.org/wiki/Combsort */
sorting/comb_sort.go:7
Function
CountingSort
(arr []int)
sorting/counting_sort.go:23
Function
GnomeSort
* * Gnome sort - https://en.wikipedia.org/wiki/Gnome_sort */
sorting/gnome_sort.go:6
Function
HeapSort
(arr []int)
sorting/heap_sort.go:35
Function
InsertionSort
* * Insertion sort - https://en.wikipedia.org/wiki/Insertion_sort */
sorting/insertion_sort.go:7
Function
MergeSort
(arr []int)
sorting/merge_sort.go:29
Method
Next
()
list/list.go:56
Function
OddEvenSort
* * Odd-Even sort - https://en.wikipedia.org/wiki/Odd-even_sort */
sorting/odd_even_sort.go:7
Method
Peek
Peek returns top of a stack without deletion
stack/stack.go:41
Method
Prev
()
list/list.go:52
Function
RandArray
(n int)
utils.go:8
Function
SelectionSort
* * Selection sort - http://en.wikipedia.org/wiki/Selection_sort */
sorting/selection_sort.go:7
Function
ShellSort
* * Shell sort - http://en.wikipedia.org/wiki/Shellsort */
sorting/shell_sort.go:6
Function
TestBinPow
TestBinPow tests binpow function
numerical/bin_pow_test.go:6
Function
TestFastPow
TestFastPow tests fastpow function
numerical/fast_pow_test.go:6
Function
TestFibonacci
(t *testing.T)
numerical/fibonacci_test.go:5
Function
TestGcd
TestGcd tests gcd
numerical/gcd_test.go:6
Function
TestPrimeFinder
TestPrimeFinder tests prime finding
numerical/prime_finder_test.go:18
Function
TestQueue
(t *testing.T)
queue/queue_test.go:30
Function
TestSort
(t *testing.T)
sorting/sort_test.go:26
Function
TestStack
(t *testing.T)
stack/stack_test.go:5
Function
TestSwap
(t *testing.T)
numerical/swap_test.go:9
Function
Test_New
(t *testing.T)
list/list_test.go:5
Function
Test_binaryTree
(t *testing.T)
binaryTree/binaryTree_test.go:9
Function
Test_minmax
(t *testing.T)
binaryTree/binaryTree_test.go:28
Function
Testfactorial
Testfactorial tests factorial function
numerical/factorial_test.go:6
Function
compare
(x interface{}, y interface{})
binaryTree/binaryTree_test.go:5
Function
main
tester
sorting/treesort.go:57
Function
main
()
sorting/radix_sort.go:12
Function
main
()
numerical/swap.go:9
Function
main
()
numerical/max_sub_array.go:25
Function
main
()
graph/shortest_distance_fw.go:43
Function
main
()
searching/breadthFirstSearch.go:50
Function
main
()
searching/linearSearch.go:14
Function
main
()
searching/jumpSearch.go:36
Function
main
()
searching/binarySearch.go:5
Function
main
()
searching/depthFirstSearch.go:50
Function
quick_sort
(arr []int)
sorting/quick_sort.go:9