Обновить 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
|
// 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user