Python 3.1 Data Structure Queue Method (Function and Main program)
Splits pq into other
priority queue, with elements of pq moved alternately to pq1 and pq2. If pq is odd in length then pq1 should should hold more element than pq2. pq is empty when the function is completes.Test it with a list of 10 random numbers. Then write another function to determine whether two given queue are identical.Entries q1 and q2 are compared and if all contents are identical and in the same order, returns true otherwise return False.
Ex. Output should look like [1,2,3,4,5,6,7,] pq1= [1,3,5,7]