Обновить sk1/compressor.c
This commit is contained in:
parent
e1b2fa79ae
commit
39d5838adc
@ -44,10 +44,10 @@ void swapMinHeapNode(struct MinHeapNode** a, struct MinHeapNode** b) {
|
||||
}
|
||||
|
||||
// MinHeapify function
|
||||
void minHeapify(struct MinHeap* minHeap, int idx) {
|
||||
unsigned smallest = idx; // Преобразуем в unsigned
|
||||
unsigned left = 2 * idx + 1; // Преобразуем в unsigned
|
||||
unsigned right = 2 * idx + 2; // Преобразуем в unsigned
|
||||
void minHeapify(struct MinHeap* minHeap, unsigned idx) {
|
||||
unsigned smallest = idx; // Changed to unsigned
|
||||
unsigned left = 2 * idx + 1; // Changed to unsigned
|
||||
unsigned right = 2 * idx + 2; // Changed to unsigned
|
||||
|
||||
if (left < minHeap->size && minHeap->array[left]->freq < minHeap->array[smallest]->freq)
|
||||
smallest = left;
|
||||
|
Loading…
Reference in New Issue
Block a user