-
-
Notifications
You must be signed in to change notification settings - Fork 585
Expand file tree
/
Copy pathSegmentTreeNode.php
More file actions
30 lines (24 loc) · 835 Bytes
/
Copy pathSegmentTreeNode.php
File metadata and controls
30 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
declare(strict_types=1);
/*
* Created by: Ramy-Badr-Ahmed (https://github.com/Ramy-Badr-Ahmed) in Pull Request #166
* https://github.com/TheAlgorithms/PHP/pull/166
*
* Please mention me (@Ramy-Badr-Ahmed) in any issue or pull request addressing bugs/corrections to this file.
* Thank you!
*/
namespace DataStructures\SegmentTree;
class SegmentTreeNode
{
public ?SegmentTreeNode $left = null;
public ?SegmentTreeNode $right = null;
/**
* @param int $start The starting index of the range.
* @param int $end The ending index of the range.
* @param int|float $value The initial aggregated value for this range (e.g. sum, min, or max).
* calculated using a callback. Defaults to sum.
*/
public function __construct(public int $start, public int $end, public $value)
{
}
}