How would you implement a mental priority queue to handle dynamically changing data?
My use case is the daily task list. I realized that I basically maintain a mental task stack (i.e., I work on the last task that occurred to me) and manage it poorly. This leads to a lot of dropped tasks and frustration. No good. I want to maintain a mental priority queue instead. Actions I’d need to perform on this queue:
- add task to queue (automatically assigned to the back of the queue)
- delete task from front of queue (just finished a prioritized task)
- delete tasks from the rest of the queue (tasks no longer need to be done)
- re-prioritize a task (by moving it forward or backward in the queue)
I’ll propose a few potential implementations:
- peg list with gaps: As I’m given new tasks, I associate them with my peg images for numbers 0, 5, 10, 15, … With gaps I have more freedom to re-prioritize tasks (e.g., if the 4th task at index number 15 becomes more important than the 2nd task at index number 5, then I can re-assign the 4th task the index number, say, 3, making it the second task). To traverse all my tasks I must traverse my peg list, which would be ~5x the length of my actual number of tasks. Not ideal
- tie peg list to memory palace: E.g., I could have a memory palace with 50 locations and tie my index to those locations.
- Zettelkasten indexing: I number my tasks 0, 1, 2, 3, … I re-prioritize tasks by giving them an identifier “[NUMBER][LETTER]”. (e.g., if the 4th task at index number 3 becomes more important than the 2nd task at index number 1, then I can re-assign the 4th task the identifier “0A”). I could keep on in this way, “[NUMBER][LETTER][number][letter]…” (e.g., “0Aia…”). To traverse all my tasks I must traverse my peg list, while checking if each item in my list has a sub-indexed item. (E.g., 0? Yes: dishes. 0A? Yes: laundry. 0Ai? No. 0AB? No. 1? Yes: vacuum). Each number is image from my peg list, small numbers are a diminuitive version of that image, letters are my shaper images.
- Memory palace with linked list extension: I place each task with object at locations 0, 1, 2, 3, … in my memory palace. If I need to re-prioritize a task, I interact with another task rather than a locus object (e.g., if the 4th task at location index number 3 becomes more important than the 2nd task at location index number 1, then I can interact it with the 1st task using a Left/Right scheme to indicate that it comes after the 1st task. The new structure would looks as follows: 0-indexed object interacting 1st task, 1st task interacting with 2nd task (previously, 4th task), 1-indexed object interacting with 3rd task (previously 2nd task), 2-indexed object interacting with 4th task (previously 3rd task).
- Memory Palace with gaps, and linked list extension: The peg list in options 1 and 2 seems unnecessary to me at this point. But still, having a way to place items sequentially and leaving space between them to handle potential re-prioritizations is still valuable. A memory palace with gaps does exactly that. And if worse comes to worst, I fill up all the gaps, and still need to re-prioritize, I can always just build a linked list (see option 6) on-the-fly off of one of those items. Not a terrible hack.
- Pure linked list / chain: Be aware of your current task and how it relates to the next task (action-upon image, color, shapes, etc.). Repeat for each subsequent task. Traversal is easy and non-redundant. Item completion only requires one to point their awareness to the next item in the list. Deletion from the middle of the list requires a little extra work. You have to unlink the item from the previous item (e.g., putting a big red “X” through it?) and re-linking that previous item to the next item. Re-prioritizing requires even more work, basically deleting the task from it’s original location in the chain, breaking the link and linking it in at its location-to-be in the chain.
I think number 4 is the best. Any thoughts?