• PHP Video Tutorials

PHP - Ds\PriorityQueue::count() Function



Ds\PriorityQueue::count() function can be used to get the count of elements present in PriorityQueue.

Syntax

public int Ds\PriorityQueue::count( void )

Ds\PriorityQueue::count() function doesn't have any parameters.

Ds\PriorityQueue::count() function can calculate the number of elements present in PriorityQueue and return the count.

Example

<?php  
   $pqueue = new \Ds\PriorityQueue();  
   $pqueue->push("Tutorials", 1); 
   $pqueue->push("Point", 2); 
   $pqueue->push("India", 3); 
  
   print_r($pqueue->count()); 
?>
php_function_reference.htm
Advertisements