Priority queue implementation uses ordered array as the underneath data structures. Code in Java, JavaScript, Python.