https://github.com/threeletters/quickmapv2
Quickmap, but much better
https://github.com/threeletters/quickmapv2
data-structure javascript
Last synced: 6 days ago
JSON representation
Quickmap, but much better
- Host: GitHub
- URL: https://github.com/threeletters/quickmapv2
- Owner: ThreeLetters
- Created: 2017-02-20T00:03:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-21T15:45:37.000Z (over 9 years ago)
- Last Synced: 2025-01-13T10:11:22.727Z (over 1 year ago)
- Topics: data-structure, javascript
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QuickMapv2
Quickmap, but much better
## The Plan
Use a key-value array with a Doubly-LinkedList
### Insertion:
1. Add the node to the linked list (var linkedlistnode = linkedlist.insert(node))
2. Add the linkedlist node into the array as the key (arr[key] = linkedlistnode)
### Deletion:
1. Get linkedlistnode from array.
2. do linkedlistnode.destroy();
### Loop
1. Loop through linkedlist
## Why?
Item deletion is expensive. But removing the pointer isnt. Also, why not use a key-value pair?
## Notes
1. Do not insert with a key used before unless you delete it with `delete()` - It wont check duplicates for efficiency
2. Do not delete a key that has not been inserted. - It wont check if it exsists for efficiency
3. Do not get from a key that has not been inserted yet - It wont check for efficiency.