Datastructure#3
Datastructure#3
Homework#2
The “DeleteItem” function starts at the beginning of the list ( index[0] )
and moves through the elements until it finds a matching key. We have these 4
scenarios we will go through them one by one.
2. After no match has been found the function simply exits without
modifying the list. The state of the list and its length remains
unchanged.
Case 4: if there was a duplicate of the same item(e.g
"Bradley" at both index 1 and 2)
1. The “DeleteItem” starts at index[0] until it locate the key “Bradley”
index[0]:no match, index[1]: match found.
2. Place a copy of the last element “Hsing” into index[1] (replacing
“Bradley”).