user1026714
user1026714

Reputation: 11

Priorities in Priority Queue

I was doing interview question on priority queues and have a simple question I was hoping to get some help with. The question is:

Should the priorities be integral? Could I implement string priorities.

Thanks in advance :-)

Upvotes: 0

Views: 575

Answers (1)

Antti Huima
Antti Huima

Reputation: 25522

?

The priorities can be anything that have a partial order defined, although a total order would be more common (e.g. integers, or strings ordered lexiographically).

Upvotes: 1

Related Questions