How to delete duplicate elements from associative array and Queue in System Verilog

In reply to javatea:

Regarding associate array sorting assuming I don’t know the value and key stored in it. So how to remove duplicates . To your question regarding “beema” or “timmy” i need to keep beema as I am following alphabetical order