diff --git a/java/17_skiplist/SkipList.java b/java/17_skiplist/SkipList.java index 83acedf1..e4aa65b6 100644 --- a/java/17_skiplist/SkipList.java +++ b/java/17_skiplist/SkipList.java @@ -78,10 +78,9 @@ public void delete(int value) { } } - while (levelCount>1&&head.forwards[levelCount]==null){ + while (levelCount > 1 && head.forwards[levelCount - 1] == null) { levelCount--; } - } // 理论来讲,一级索引中元素个数应该占原始数据的 50%,二级索引中元素个数占 25%,三级索引12.5% ,一直到最顶层。