+ 1

Help me (Priority Queue, Data Structure, C language)

Whats wrong with this code? Why the last Gold and Platinum don't go to their priority place? https://sololearn.com/compiler-playground/cVMh5c3MzYip/?ref=app

1st Apr 2024, 4:22 AM
Briana
Briana - avatar
3 Réponses
0
As soon as the first Platinum is in the queue, all other priorities are either greater or equal to the head's priority. Thus, all others are added to the queue via the code block at line 43.
1st Apr 2024, 6:36 AM
Gordie
Gordie - avatar
0
Gordie isn't it suppossed to be : cccc Platinum gggg Platinum bbbb Gold ffff Gold aaaa Silver dddd Silver eeee Silver ??
3rd Apr 2024, 5:22 AM
Briana
Briana - avatar
0
I suppose so. I was merely pointing out where there is a logical error in your code.
3rd Apr 2024, 11:08 AM
Gordie
Gordie - avatar