What is a priority queue and how to implement it. Plus priority queues use cases and the heapsort algorithm.
Love the reminder/review of fundamentals.
parent(i) = floor(i/2) -1
should be
parent(i) = floor((i - 1) / 2)
Or ceil(i/2)-1
Love the reminder/review of fundamentals.
parent(i) = floor(i/2) -1
should be
parent(i) = floor((i - 1) / 2)
Or ceil(i/2)-1