MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / CheckRangeFromIndex

Method CheckRangeFromIndex

structure/dynamicarray/dynamicarray.go:88–93  ·  view source on GitHub ↗

CheckRangeFromIndex function it will check the range from the index

(index int)

Source from the content-addressed store, hash-verified

86
87// CheckRangeFromIndex function it will check the range from the index
88func (da *DynamicArray) CheckRangeFromIndex(index int) error {
89 if index >= da.Size || index < 0 {
90 return errors.New("index out of range")
91 }
92 return nil
93}
94
95// NewCapacity function increase the Capacity
96func (da *DynamicArray) NewCapacity() {

Callers 3

PutMethod · 0.95
RemoveMethod · 0.95
GetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected