The records of students in a school are kept in order of their arrival. What…