1. var CQueue = function() {
    2. this.s = [];
    3. this.t = [];
    4. };
    5. CQueue.prototype.appendTail = function(value) {
    6. this.s.push(value);
    7. };
    8. CQueue.prototype.deleteHead = function(){
    9. if (this.t.length) {
    10. return this.t.pop();
    11. }
    12. while(this.s.length){
    13. this.t.push(this.s.pop());
    14. }
    15. return this.t.pop();
    16. }