Обновить sk1/compressor.c

This commit is contained in:
Yevhen Kozirovskyi 2025-01-19 17:58:04 +00:00
parent e1b2fa79ae
commit 39d5838adc

View File

@ -44,10 +44,10 @@ void swapMinHeapNode(struct MinHeapNode** a, struct MinHeapNode** b) {
} }
// MinHeapify function // MinHeapify function
void minHeapify(struct MinHeap* minHeap, int idx) { void minHeapify(struct MinHeap* minHeap, unsigned idx) {
unsigned smallest = idx; // Преобразуем в unsigned unsigned smallest = idx; // Changed to unsigned
unsigned left = 2 * idx + 1; // Преобразуем в unsigned unsigned left = 2 * idx + 1; // Changed to unsigned
unsigned right = 2 * idx + 2; // Преобразуем в unsigned unsigned right = 2 * idx + 2; // Changed to unsigned
if (left < minHeap->size && minHeap->array[left]->freq < minHeap->array[smallest]->freq) if (left < minHeap->size && minHeap->array[left]->freq < minHeap->array[smallest]->freq)
smallest = left; smallest = left;