Documentation
¶
Index ¶
- func BinarySearch(arr []int, target int) int
- func BinarySearchRecursive(arr []int, target int) int
- func BoyerMooreSearch(text, pattern string) []int
- func BubbleSort(arr []int) []int
- func CountingSort(arr []int) []int
- func CountingSortBytes(arr []byte) []byte
- func CountingSortString(str string) string
- func CountingSortWithRange(arr []int, minVal, maxVal int) []int
- func ExponentialSearch(arr []int, target int) int
- func FibonacciSearch(arr []int, target int) int
- func HeapSort(arr []int) []int
- func HibbardGaps(n int) []int
- func InsertionSort(arr []int) []int
- func InterpolationSearch(arr []int, target int) int
- func JumpSearch(arr []int, target int) int
- func KMPSearch(text, pattern string) []int
- func LevenshteinDistance(str1, str2 string) int
- func LinearSearch(arr []int, target int) int
- func LongestCommonSubsequence(text1, text2 string) string
- func MergeSort(arr []int) []int
- func PrattGaps(n int) []int
- func QuickSort(arr []int) []int
- func RabinKarpSearch(text, pattern string) []int
- func RadixSort(arr []int) []int
- func RadixSortBytes(arr [][]byte) [][]byte
- func RadixSortString(arr []string) []string
- func RecursiveCountNQueensSolutions(n int) int
- func RecursiveFactorial(n int) int
- func RecursiveGetNQueensBoard(solution []int) []string
- func RecursiveIsValidNQueensSolution(solution []int) bool
- func RecursiveNQueens(n int) [][]int
- func RecursiveReverseString(s string) string
- func SedgewickGaps(n int) []int
- func ShellSort(arr []int) []int
- func ShellSortWithGaps(arr []int, gaps []int) []int
- func SortingSort(arr []int) []int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinarySearch ¶
BinarySearch performs binary search on a sorted slice
func BinarySearchRecursive ¶
BinarySearchRecursive performs recursive binary search on a sorted slice
func BoyerMooreSearch ¶
BoyerMooreSearch performs Boyer-Moore pattern searching
func BubbleSort ¶
BubbleSort performs bubble sort on an integer slice
func CountingSort ¶
CountingSort implements the Counting Sort algorithm for non-negative integers Time Complexity: O(n + k) where n is the number of elements and k is the range of input Space Complexity: O(k)
func CountingSortBytes ¶ added in v1.1.0
CountingSortBytes implements Counting Sort for byte slices This is useful for sorting binary data or custom encodings
func CountingSortString ¶ added in v1.1.0
CountingSortString sorts a string using counting sort algorithm
func CountingSortWithRange ¶ added in v1.1.0
CountingSortWithRange implements Counting Sort for a known range of integers This version is more efficient when the range is known and smaller than the array size
func ExponentialSearch ¶
ExponentialSearch performs exponential search on a sorted slice
func FibonacciSearch ¶
FibonacciSearch performs Fibonacci search on a sorted slice
func InsertionSort ¶
InsertionSort performs insertion sort on an integer slice
func InterpolationSearch ¶
InterpolationSearch performs interpolation search on a sorted slice
func JumpSearch ¶
JumpSearch performs jump search on a sorted slice
func LevenshteinDistance ¶
LevenshteinDistance calculates the minimum number of single-character edits required to change one string into another
func LinearSearch ¶
LinearSearch performs linear search on a slice
func LongestCommonSubsequence ¶
LongestCommonSubsequence finds the longest common subsequence of two strings
func RabinKarpSearch ¶
RabinKarpSearch performs Rabin-Karp pattern searching
func RadixSort ¶ added in v1.1.0
RadixSort implements the Radix Sort algorithm for non-negative integers Time Complexity: O(d * (n + k)) where d is the number of digits, n is the number of elements and k is the range of values for each digit (10 for decimal)
func RadixSortBytes ¶ added in v1.1.0
RadixSortBytes implements Radix Sort for byte slices of equal length
func RadixSortString ¶ added in v1.1.0
RadixSortString implements Radix Sort for strings This implementation sorts strings of equal length
func RecursiveCountNQueensSolutions ¶ added in v1.1.0
RecursiveCountNQueensSolutions returns the number of solutions for the N-Queens problem
func RecursiveFactorial ¶ added in v1.1.0
RecursiveFactorial calculates n! recursively
func RecursiveGetNQueensBoard ¶ added in v1.1.0
RecursiveGetNQueensBoard converts a solution to a 2D board representation Returns a slice of strings where 'Q' represents a queen and '.' represents an empty cell
func RecursiveIsValidNQueensSolution ¶ added in v1.1.0
RecursiveIsValidNQueensSolution verifies if a given solution is valid
func RecursiveNQueens ¶ added in v1.1.0
RecursiveNQueens solves the N-Queens problem and returns all solutions Each solution is represented as a slice of integers where the index represents the row and the value represents the column where a queen is placed
func RecursiveReverseString ¶ added in v1.1.0
RecursiveReverseString reverses a string using recursion
func SedgewickGaps ¶ added in v1.1.0
Sedgewick sequence: 4^k + 3 * 2^(k-1) + 1
func ShellSort ¶ added in v1.1.0
ShellSort implements the Shell Sort algorithm Shell sort is an optimization of insertion sort that allows the exchange of items that are far apart
func ShellSortWithGaps ¶ added in v1.1.0
ShellSortWithGaps implements Shell Sort with custom gap sequence This version allows you to specify the gap sequence to use
func SortingSort ¶ added in v1.1.0
SortingSort performs counting sort on an integer slice
Types ¶
This section is empty.