Queue
类应该有一个enqueue
方法。
testString: assert((function(){var test = new Queue(); return (typeof test.enqueue === 'function')}()));
- text: 您的Queue
类应该有一个dequeue
方法。
testString: assert((function(){var test = new Queue(); return (typeof test.dequeue === 'function')}()));
- text: 您的Queue
类应该有一个front
方法。
testString: assert((function(){var test = new Queue(); return (typeof test.front === 'function')}()));
- text: 您的Queue
类应该有一个size
方法。
testString: assert((function(){var test = new Queue(); return (typeof test.size === 'function')}()));
- text: 您的Queue
类应该有一个isEmpty
方法。
testString: assert((function(){var test = new Queue(); return (typeof test.isEmpty === 'function')}()));
- text: dequeue
方法应该删除并返回队列的前端元素
testString: assert((function(){var test = new Queue(); test.enqueue('Smith'); test.enqueue('John'); return (test.dequeue() === 'Smith')}()));
- text: front
方法应该返回队列的front元素的值
testString: assert((function(){var test = new Queue(); test.enqueue('Smith'); test.enqueue('John'); return (test.front() === 'Smith')}()));
- text: size
方法应该返回队列的长度
testString: assert((function(){var test = new Queue(); test.enqueue('Smith'); return (test.size() === 1)}()));
- text: 如果队列中有元素,则isEmpty
方法应返回false
testString: assert((function(){var test = new Queue(); test.enqueue('Smith'); return !(test.isEmpty())}()));
```