PHP 클래스 HTMLPurifier_Queue, yii

We don't use the SPL implementation because it's only supported on PHP 5.3 and later. Exercise: Prove that push/pop on this queue take amortized O(1) time. Exercise: Extend this queue to be a deque, while preserving amortized O(1) time. Some care must be taken on rebalancing to avoid quadratic behaviour caused by repeatedly shuffling data from the input stack to the output stack and back.
파일 보기 프로젝트 열기: yiisoft/yii

공개 메소드들

메소드 설명
__construct ( $input = [] )
isEmpty ( ) Checks if it's empty.
push ( $x ) Pushes an element onto the front of the queue.
shift ( ) Shifts an element off the front of the queue.

메소드 상세

__construct() 공개 메소드

public __construct ( $input = [] )

isEmpty() 공개 메소드

Checks if it's empty.
public isEmpty ( )

push() 공개 메소드

Pushes an element onto the front of the queue.
public push ( $x )

shift() 공개 메소드

Shifts an element off the front of the queue.
public shift ( )