The following interface is displayed after choosing the function Enter books from the main interface.
The implementation of this interface has the following features:
Adding a new record to the data file requires that we also add an entry to the index.
The newly entered record will be appended to the book file data.txt.
This operation is simple and straightforward.
Since the index is kept in sorted order by key, insertion of the new index entry probably requires some rearrangement of the index.
We have to shift or slide all the entries with keys that come in order after the key of the record we are inserting.
The shifting opens up a space for the new entry.