Completed
Push — master ( 6eae43...6111f5 )
by Siro Díaz
02:03
created

AVLNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace DataStructures\Trees\Nodes;
4
5
use DataStructures\Trees\Nodes\BSTNode;
6
7
/**
8
 * AVLNode is the container class that represent a node inside a AVL tree.
9
 * It is like BST node but has an adicional attribute: height. Height is used
10
 * to know when to balance the AVL tree.
11
 *
12
 * @author Siro Diaz Palazon <[email protected]>
13
 */
14
class AVLNode extends BSTNode {
15
    public $height;
16
17
    public function __construct($key, $data, AVLNode $parent = null, AVLNode $left = null, AVLNode $right = null) {
18
        parent::__construct($key, $data, $parent, $left, $right);
19
        $this->height = 0;
20
    }
21
}