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 16
16
},
17
17
"require-dev" : {
18
18
"phpunit/phpunit" : " 6.5"
19
- },
20
- "require" : {
21
- "doganoo/php-util" : " 0.0.1"
22
19
}
23
20
}
Original file line number Diff line number Diff line change 28
28
29
29
use doganoo \PHPAlgorithms \Datastructure \Graph \Graph \Node ;
30
30
use doganoo \PHPAlgorithms \Datastructure \Lists \ArrayLists \ArrayList ;
31
- use doganoo \PHPUtil \Log \Logger ;
32
31
33
32
/**
34
33
* Class AbstractTraverse
@@ -44,7 +43,7 @@ abstract class AbstractGraphSearch {
44
43
public function __construct () {
45
44
$ this ->visited = new ArrayList ();
46
45
$ this ->callable = function ($ value ) {
47
- Logger:: debug ( $ value) ;
46
+ echo $ value ;
48
47
};
49
48
}
50
49
@@ -62,7 +61,7 @@ public function visit($value) {
62
61
if (null === $ this ->callable
63
62
&& !\is_callable ($ this ->callable )) {
64
63
$ callable = function ($ otherValue ) {
65
- Logger:: debug ( $ otherValue) ;
64
+ echo $ otherValue ;
66
65
};
67
66
}
68
67
$ callable ($ value );
Original file line number Diff line number Diff line change 27
27
28
28
29
29
use doganoo \PHPAlgorithms \Common \Interfaces \IBinaryNode ;
30
- use doganoo \PHPUtil \Log \Logger ;
31
30
32
31
/**
33
32
* Class AbstractTraverse
@@ -57,7 +56,7 @@ public function visit($value) {
57
56
if (null === $ this ->callable
58
57
&& !\is_callable ($ this ->callable )) {
59
58
$ callable = function ($ otherValue ) {
60
- Logger:: debug ( $ otherValue) ;
59
+ echo $ otherValue ;
61
60
};
62
61
}
63
62
$ callable ($ value );
Original file line number Diff line number Diff line change 26
26
namespace doganoo \PHPAlgorithms \Datastructure \Graph \Tree \Heap ;
27
27
28
28
use doganoo \PHPAlgorithms \Common \Util \Comparator ;
29
- use doganoo \PHPUtil \Log \Logger ;
30
29
31
30
/**
32
31
* Class MaxHeap
@@ -63,16 +62,6 @@ public function clear(): bool {
63
62
return \count ($ this ->heap ) === 1 && $ this ->heap [0 ] == \PHP_INT_MIN ;
64
63
}
65
64
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
-
76
65
/**
77
66
* returns the number of elements in the heap
78
67
*
Original file line number Diff line number Diff line change 26
26
namespace doganoo \PHPAlgorithms \Datastructure \Graph \Tree \Heap ;
27
27
28
28
use doganoo \PHPAlgorithms \Common \Util \Comparator ;
29
- use doganoo \PHPUtil \Log \Logger ;
30
-
31
29
32
30
/**
33
31
* Class MinHeap
@@ -64,16 +62,6 @@ public function clear(): bool {
64
62
return \count ($ this ->heap ) === 1 && $ this ->heap [0 ] === \PHP_INT_MIN ;
65
63
}
66
64
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
-
77
65
/**
78
66
* returns the number of elements in the heap
79
67
*
You can’t perform that action at this time.
0 commit comments