This commit is contained in:
zzz
2011-03-26 05:50:13 +00:00
parent 312534b635
commit a7fceb644f
2 changed files with 13 additions and 0 deletions

View File

@@ -94,6 +94,13 @@ public class SkipLevels {
return bottom.get(key);
}
/**
* @return An array of two objects or null.
* rv[0] is the removed object.
* rv[1] is the deleted SkipLevels if the removed object was the last in the SkipLevels,
* and the deleted SkipLevels is taller than this SkipLevels.
* rv is null if no object was removed.
*/
public Object[] remove(int start, Comparable key, SkipList sl) {
Object[] res = null;
SkipLevels slvls = null;

View File

@@ -225,6 +225,12 @@ public class SkipSpan {
}
}
/**
* @return An array of two objects or null.
* rv[0] is the removed object.
* rv[1] is the deleted SkipSpan if the removed object was the last in the SkipSpan.
* rv is null if no object was removed.
*/
public Object[] remove(Comparable key, SkipList sl) {
if(nKeys == 0) { return null; }
if(keys[nKeys - 1].compareTo(key) < 0) {