PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Carlos Blanco Domínguez   Polymorphic Queue   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Polymorphic Queue
Implement a LIFO queue with arrays
Author: By
Last change:
Date: 17 years ago
Size: 310 bytes
 

Contents

Class file image Download
<?php
require_once("queue.php");

$q=&new queue();

for(
$i=1;$i<=10; $i+=2) $q->push($i);

$q->debug();

printf("The top of the queue is %d <br>",$q->top());
printf("The number of elements of the stack is %d <br>",$q->count());


while (!
$q->isempty()) printf("Poped element %d , ",$q->pop());
?>