This is a tutorial to show the basic API usage of big array, the source of this tutorial is here.
Big array is a building block of big queue, since big array is also a valuable data struture with unique feature, I decided to write a separate tutorial for it.
The interface of big array is here, basically, it’s simple and similar to a typical indexed array except that big array is an append only array, you can’t randomly append data in big array like typical array after allocation, you can only append data on head of the array, although you can randomly read data by index in big array after you append data to it.
You can create(initialize) a new big array in just on statement:
1 2 |
|
the first parameter is a directory you want to store the array data file, the second parameter is the array name. Now you have a reference to an empty array.