QuickMapv2
Quickmap, but much better
The Plan
Use a key-value array with a Doubly-LinkedList
Insertion:
- Add the node to the linked list (var linkedlistnode = linkedlist.insert(node))
- Add the linkedlist node into the array as the key (arr[key] = linkedlistnode)
Deletion:
- Get linkedlistnode from array.
- do linkedlistnode.destroy();
Loop
- Loop through linkedlist
Why?
Item deletion is expensive. But removing the pointer isnt. Also, why not use a key-value pair?
Notes
- Do not insert with a key used before unless you delete it with
delete()
- It wont check duplicates for efficiency - Do not delete a key that has not been inserted. - It wont check if it exsists for efficiency
- Do not get from a key that has not been inserted yet - It wont check for efficiency.