Source File
arraylist.go
Belonging Package
github.com/emirpasic/gods/lists/arraylist
type List struct {
elements []interface{}
size int
}
const (
growthFactor = float32(2.0) // growth by 100%
shrinkFactor = float32(0.25) // shrink when size is 25% of capacity (0 means never shrink)
)
func ( *List) (, int) {
if .withinRange() && .withinRange() {
.elements[], .elements[] = .elements[], .elements[]
}
}
func ( *List) () {
if shrinkFactor == 0.0 {
return
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |