// insert insert a data to array.
insert insert a data to array.
// insert insert a data to array .
func (a *Array) insert(index int, value string) error {
	if a.length == int(cap(a.data)) {
		return errors.New("a array is full")
	}
	if index != a.length && index >= a.length {
		return errors.New("out of index range")
	}
	for i := a.length; i > index; i-- {
		a.data[i] = a.data[i-1]
	}
	a.data[index] = value
	a.length++
	return nil
}
func ( a * Array ) insert ( index int , value string ) error { if a . length == int ( cap ( a . data ) ) { return errors . New ( " " ) } if index != a . length && index >= a . length { return errors . New ( " " ) } for i := a . length ; i > index ; i -- { a . data [ i ] = a . data [ i - 1 ] } a . data [ index ] = value a . length ++ return nil }
insert insert a data to array.
insert insert a data to array .
// shift data // insert a value to target index // update the length