Skip to content

Implement iterable instantiation  #16

@jay-tyler

Description

@jay-tyler

Want to instantiate PriorityQ with an iterable filled with val, priority iterables.

e.g.

PriorityQ[(1,3), (2, 4), ((4,3,4), 0), [[1,2,3,4], 5]) 

where each internal container is val, priority

We will also support using QNode as a flat level instantiator
e.g.

 PriorityQ[QNode(1,2), (3,4) (4,3), QNode(2,1)]

Internally, implementation will follow this provisional order (any changes to this will be advertised here):

  1. examine the incoming items in iterable
  2. if QNode, assign order and push to heap
  3. if not, introspect item
  4. if conforms to our proposed API: (val, priority):
  5. init QNode with that priority, assign order, and push to heap
  6. If no priority is supplied:
  7. init QNode without priority, assign order, and push to heap

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions