跳表删除元素后,需要更新levelcount

This commit is contained in:
yanglong09 2019-08-20 13:24:23 +08:00
parent 31b0908077
commit fa95fa8b90

View File

@ -79,6 +79,11 @@ public class SkipList {
}
}
}
while (levelCount>1&&head.forwards[levelCount]==null){
levelCount--;
}
}
// 随机 level 如果是奇数层数 +1防止伪随机