minor.
This commit is contained in:
parent
a3d2c0a089
commit
e41a44b9a4
@ -363,6 +363,8 @@ RBT.prototype.rotr = function rotr(x) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
RBT.prototype.min = function min(z) {
|
RBT.prototype.min = function min(z) {
|
||||||
|
if (z.isNull())
|
||||||
|
return z;
|
||||||
while (!z.left.isNull())
|
while (!z.left.isNull())
|
||||||
z = z.left;
|
z = z.left;
|
||||||
return z;
|
return z;
|
||||||
@ -376,6 +378,8 @@ RBT.prototype.min = function min(z) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
RBT.prototype.max = function max(z) {
|
RBT.prototype.max = function max(z) {
|
||||||
|
if (z.isNull())
|
||||||
|
return z;
|
||||||
while (!z.right.isNull())
|
while (!z.right.isNull())
|
||||||
z = z.right;
|
z = z.right;
|
||||||
return z;
|
return z;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user