array

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package array gives all array related functions like search, copy, clone, remove, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinarySearch

func BinarySearch[T cmp.Ordered](elements []T, element T) int

Search for the element in the arraylist and gives the first index of the element otherwise -1 .

This is only aplicable if the array is sorted

func LinearSearch

func LinearSearch[T comparable](elements []T, element T) int

Search for the element in the arraylist and gives the first index of the element otherwise -1

func LinearSearchX

func LinearSearchX[T comparable](elements []T, element T) int

This is a exprimental searching algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL