The Ds\Sequence::allocate() function is an inbuilt function in PHP which is used to allocate enough memory for required capacity.
void abstract public Ds\Sequence::allocate ( int $capacity )
Parameter: This function accepts single parameter $capacity which indicate number of capacity allocated.
Return value: This function does not return any values.
Below programs illustrate the Ds\Sequence::allocate() function in PHP:
int(8) int(50) int(80)
int(10) int(20) int(30) int(40)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.