Delete Key Property 3

If the key we are looking for is not equal to the key in the first entry in the "remaining" map, then pop this entry and prepend it to "processed," since this isn't the entry we are deleting. More formally:

output of function delete_entry where input key is key, map is [ pair (lkey, lvalue), remaining ], and processed is kvs = output of function delete_entry where input key is key, map is remaining, and processed is [ pair (lkey, lvalue), kvs ]

Examples

output of function delete_entry where input key is "FL", map is [ pair ("OH", "Ohio"), [ entry "AZ": "Arizona", [ entry "TX": "Texas", [ ] ] ] ], and processed is [ entry "ID": "Idaho", [ ] ] = output of function delete_entry where input key is "FL", map is [ entry "AZ": "Arizona", [ entry "TX": "Texas", [ ] ] ], and processed is [ pair ("OH", "Ohio"), [ entry "ID": "Idaho", [ ] ] ]

Quiz (1 point)

Please fill in the blank:

(result of deleting the entry with key "MT" in remaining entries [ entry "EST":"Eastern Time", [ ] ] and processed entries: [ entry "CST":"Central Time", [ ] ]) = (result of deleting the entry with key: "MT" in remaining entries: [ ] and processed entries: __________ )

Become a subscriber to save your progress, see the correct answer, and more!

Comments

Please log in to add comments