Chapter 8 Dictionaries | 8.5
Algorithm 8.2: SINSERT(list, key, Item)
1. Set p=list[head]
2. Loop for i=list[level] to 1 do
1. Loop while p=key[forward[i]]<key do
2. Set p=p[forward[i]]
3. Set ip[i]=p
3. Set p=p[forward[1]
4. Check whether p[key]=key then
Set p[value]=Item
5. Else
1. Set |v|=rdLevel()
2. Check whether |v|>list[level] then
1. Loop for i=list[level+] to |v| do
Set ip[i]=list[head]
2. Set list[level]=|v|
3. Set p=MakeNode(|v|, key, value)
4. Loop for i=1 to level do
Set p[forward[i]]=ip[i] of forward[i]
Set ip[i] of forward[i]=p
6. End
8.3.4 DELETION
Deletion process also requires to search for the key to delete the corresponding key–value pair. A er identify-
ing it the vector
i.p
points to the node that ...