As title, AVL tree should do balance when height diff larger than 1. But the code in immut/sorted_set/immutable_set.mbt is
fn balance[A : Compare](left : T[A], value : A, right : T[A]) -> T[A] {
let left_height = left.height()
let right_height = right.height()
if left_height > right_height + 2 {
match left {
...
I tried to modify it to if left_height >= right_height + 2, but there is no obvious performance improvement.
I'm not sure if it's necessary to fix.
As title, AVL tree should do balance when height diff larger than 1. But the code in
immut/sorted_set/immutable_set.mbt
isI tried to modify it to
if left_height >= right_height + 2
, but there is no obvious performance improvement. I'm not sure if it's necessary to fix.