File tree Expand file tree Collapse file tree 5 files changed +3
-31
lines changed
Datastructure/Graph/Tree/Heap Expand file tree Collapse file tree 5 files changed +3
-31
lines changed Original file line number Diff line number Diff line change 1616 },
1717 "require-dev" : {
1818 "phpunit/phpunit" : " 6.5"
19- },
20- "require" : {
21- "doganoo/php-util" : " 0.0.1"
2219 }
2320}
Original file line number Diff line number Diff line change 2828
2929use doganoo \PHPAlgorithms \Datastructure \Graph \Graph \Node ;
3030use doganoo \PHPAlgorithms \Datastructure \Lists \ArrayLists \ArrayList ;
31- use doganoo \PHPUtil \Log \Logger ;
3231
3332/**
3433 * Class AbstractTraverse
@@ -44,7 +43,7 @@ abstract class AbstractGraphSearch {
4443 public function __construct () {
4544 $ this ->visited = new ArrayList ();
4645 $ this ->callable = function ($ value ) {
47- Logger:: debug ( $ value) ;
46+ echo $ value ;
4847 };
4948 }
5049
@@ -62,7 +61,7 @@ public function visit($value) {
6261 if (null === $ this ->callable
6362 && !\is_callable ($ this ->callable )) {
6463 $ callable = function ($ otherValue ) {
65- Logger:: debug ( $ otherValue) ;
64+ echo $ otherValue ;
6665 };
6766 }
6867 $ callable ($ value );
Original file line number Diff line number Diff line change 2727
2828
2929use doganoo \PHPAlgorithms \Common \Interfaces \IBinaryNode ;
30- use doganoo \PHPUtil \Log \Logger ;
3130
3231/**
3332 * Class AbstractTraverse
@@ -57,7 +56,7 @@ public function visit($value) {
5756 if (null === $ this ->callable
5857 && !\is_callable ($ this ->callable )) {
5958 $ callable = function ($ otherValue ) {
60- Logger:: debug ( $ otherValue) ;
59+ echo $ otherValue ;
6160 };
6261 }
6362 $ callable ($ value );
Original file line number Diff line number Diff line change 2626namespace doganoo \PHPAlgorithms \Datastructure \Graph \Tree \Heap ;
2727
2828use doganoo \PHPAlgorithms \Common \Util \Comparator ;
29- use doganoo \PHPUtil \Log \Logger ;
3029
3130/**
3231 * Class MaxHeap
@@ -63,16 +62,6 @@ public function clear(): bool {
6362 return \count ($ this ->heap ) === 1 && $ this ->heap [0 ] == \PHP_INT_MIN ;
6463 }
6564
66- /**
67- * displays the heap
68- */
69- public function display () {
70- for ($ i = 1 ; $ i <= $ this ->length () / 2 ; $ i ++) {
71- $ string = "Parent Node: " . $ this ->heap [$ i ] . " Left Child: " . $ this ->heap [2 * $ i ] . " Right Child: " . $ this ->heap [2 * $ i + 1 ];
72- Logger::debug ($ string );
73- }
74- }
75-
7665 /**
7766 * returns the number of elements in the heap
7867 *
Original file line number Diff line number Diff line change 2626namespace doganoo \PHPAlgorithms \Datastructure \Graph \Tree \Heap ;
2727
2828use doganoo \PHPAlgorithms \Common \Util \Comparator ;
29- use doganoo \PHPUtil \Log \Logger ;
30-
3129
3230/**
3331 * Class MinHeap
@@ -64,16 +62,6 @@ public function clear(): bool {
6462 return \count ($ this ->heap ) === 1 && $ this ->heap [0 ] === \PHP_INT_MIN ;
6563 }
6664
67- /**
68- * displays the heap
69- */
70- public function display () {
71- for ($ i = 1 ; $ i <= $ this ->length () / 2 ; $ i ++) {
72- $ string = "Parent Node: " . $ this ->heap [$ i ] . " Left Child: " . $ this ->heap [2 * $ i ] . " Right Child: " . $ this ->heap [2 * $ i + 1 ];
73- Logger::debug ($ string );
74- }
75- }
76-
7765 /**
7866 * returns the number of elements in the heap
7967 *
You can’t perform that action at this time.
0 commit comments