%This function deletes the next event from the list of pending
%events giving the serial number of this event and the updated list.
%>>>The input is:
% 1) listOfPendingEvents: list of pending events where the first column is
% the type of event, the second column is the arrived/end time of the flow
% and the third column is the serial number of the flow.
%>>>The outputs are:
% 1) serialNumber: serial number of the next flow.
% 2) listOfPendingEvents: updated 'listOfPendingEvents'. We delete the next
% event from the list.
serialNumber = listOfPendingEvents(1,3);
listOfPendingEvents = listOfPendingEvents(2:end,:);