Sample T erminal Sessions ��� makeEmpty�Q��� Q� � q�X��X�� ��� makeEmpty�Q��� enqueue�a�Q��Q��� Q� � q��a�X��� X�� ��� makeEmpty�Q��� enqueue�a�Q��Q��� enqueue�b�Q��Q��� Q� � q��a�b�X��� X�� ��� makeEmpty�Q��� enqueue�a�Q��Q��� enqueue�b�Q��Q��� enqueue�c�Q��Q��� enqueue�d�Q��Q��� Q� � q��a�b�c�d�X��� X�� �
��� makeEmpty�Q��� enqueue�a�Q��Q��� enqueue�b�Q��Q��� enqueue�c�Q��Q��� enqueue�d�Q��Q��� dequeue�A�Q��Q��� A � a Q� � q��b�c�d�X��� X�� ��� makeEmpty�Q��� enqueue�a�Q��Q��� enqueue�b�Q��Q��� enqueue�c�Q��Q��� enqueue�d�Q��Q��� dequeue���Q��Q��� dequeue�A�Q��Q��� A � b Q� � q��c�d�X��� X�� ��� makeEmpty�Q��� enqueue�a�Q��Q��� enqueue�b�Q��Q��� enqueue�c�Q��Q��� enqueue�d�Q��Q��� dequeue���Q��Q��� dequeue���Q��Q��� enqueue�e�Q��Q��� Q� � q��c�d�e�X��� X�� �
E�cient Queues Mak e�Queue Program and Query � makeEmpty�q�X�X��� ��� makeEmpty�Q�� Q � q�X�X� Enqueue Program and Query� enqueue�A� q�L�X�� q�L�Y�� �� X � �A�Y�� i�e�� replace X by �A�Y� in L� ��� enqueue�d� q��a�b�c�X��X�� Q�� Q � q��a�b�c�d�Y�� Y� �
E�cient Queues �Cont�d� Dequeue Program and Query� dequeue�A� q�L��Y�� q�L��Y�� �� L� � �A�L��� i�e�� extract A and L� from L�� ��� dequeue�A� q��a�b�c�d�Y��Y�� Q�� A � a Q � q��b�c�d�Y��Y�� �
Recommend
More recommend