Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
9 / 9 |
MinPriorityQueue | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
9 / 9 |
__construct() // [\SplPriorityQueue] | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
extractInsert($value, $priority) // -> mixed | |
100.00% |
1 / 1 |
1 | |
100.00% |
7 / 7 |
<?php namespace SEIDS\Heaps\Binary; | |
//============================================================================== | |
// PHP SEIDS: Supplementary, Easily Interchangeable Data Structures | |
// | |
// Copyright 2015, Daniel A.C. Martin | |
// Distributed under the MIT License. | |
// (See LICENSE file for details.) | |
//============================================================================== | |
use \SEIDS\Heaps\PriorityQueueHeapItem; | |
class MinPriorityQueue extends \SEIDS\Heaps\MinPriorityQueue | |
{ | |
public function __construct() // [\SplPriorityQueue] | |
{ | |
$this->DataStructure = new PriorityQueueHeap(array($this, 'compare')); | |
} | |
public function extractInsert($value, $priority) // -> mixed | |
{ | |
return $this->processExtract | |
( | |
$this->DataStructure->extractInsert | |
( | |
new PriorityQueueHeapItem($value, $priority) | |
) | |
); | |
} | |
} | |