Skip to content

Commit

Permalink
chore: commenting printfs used for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelruhmanSamy authored and amir-kedis committed Apr 27, 2024
1 parent 502fbf9 commit 7749836
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions code/minHeap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ min_heap *createMinHeap(int (*comp)(void *, void *)) {
*/
void insertMinHeap(min_heap **heap, void *element) {
// if(DEBUG){
printf("entered insertion safely\n");
printHeap((*heap));
// printf("entered insertion safely\n");
// printHeap((*heap));
// }
//
// FIXME: something here is not working size increae then decrease suddenly
Expand All @@ -39,7 +39,7 @@ void insertMinHeap(min_heap **heap, void *element) {

decreaseKey((*heap), (*heap)->size - 1);

printHeap(*heap);
// printHeap(*heap);
}

/**
Expand All @@ -57,7 +57,7 @@ void *extractMin(min_heap *heap) {
heap->arr[heap->size] = 0;
minHeapify(heap, 0);

printHeap(heap);
// printHeap(heap);
return minElement;
}

Expand Down Expand Up @@ -123,8 +123,8 @@ void minHeapify(min_heap *heap, int ind) {
* - freeing memory of the old heap
*/
min_heap **doubleCapacity(min_heap* heap) {
printf("Entered doubleCapacity with the following heap:!!\n");
printHeap(heap);
// printf("Entered doubleCapacity with the following heap:!!\n");
// printHeap(heap);

min_heap *newHeap = malloc(sizeof(*newHeap));
newHeap->capacity = 2 * heap->capacity;
Expand All @@ -136,9 +136,9 @@ min_heap **doubleCapacity(min_heap* heap) {

min_heap **returnval = &newHeap;

printf("doubling occurred!!\n");
printHeap(*returnval);
printf("Exiting doubleCapcity\n");
// printf("doubling occurred!!\n");
// printHeap(*returnval);
// printf("Exiting doubleCapcity\n");
return returnval;
}

Expand Down

0 comments on commit 7749836

Please sign in to comment.