4
4
#include "../../Trees/Headers/BinaryHeap.h"
5
5
6
6
7
-
8
-
9
7
/** This function will return the first child index,
10
8
* of the passed parent index.
11
9
*
@@ -50,7 +48,6 @@ void hpQueueSwap(void **arr, int fIndex, int sIndex) {
50
48
}
51
49
52
50
53
-
54
51
/** This function will heap down the value in the passed index until it be in the right place.
55
52
*
56
53
* @param arr the array pointer
@@ -91,7 +88,6 @@ void hpQueueHeapDown(void **arr, int currentIndex, int length, int (*cmp)(const
91
88
}
92
89
93
90
94
-
95
91
/** This function will allocate a new heap priority queue then it will return its pointer.
96
92
*
97
93
* @param freeFn the free function pointer, that will be called to free the queue items
@@ -132,9 +128,6 @@ HPriorityQueue *hPriorityQueueInitialization(void (*freeFn)(void *), int (*cmp)(
132
128
}
133
129
134
130
135
-
136
-
137
-
138
131
/** This function will insert the passed item in the queue.
139
132
*
140
133
* @param queue the queue pointer
@@ -167,8 +160,6 @@ void hpQueueEnqueue(HPriorityQueue *queue, void *item) {
167
160
}
168
161
169
162
170
-
171
-
172
163
/** This function will insert all the passed array items in the queue.
173
164
*
174
165
* @param queue the queue pointer
@@ -201,8 +192,6 @@ void hpQueueEnqueueAll(HPriorityQueue *queue, void *items, int length) {
201
192
}
202
193
203
194
204
-
205
-
206
195
/** This function will remove the first item from the queue,
207
196
* then it will return it.
208
197
*
@@ -237,8 +226,6 @@ void *hpQueueDequeue(HPriorityQueue *queue) {
237
226
}
238
227
239
228
240
-
241
-
242
229
/** This function will return the first item in the queue without removing it from the queue.
243
230
*
244
231
* @param queue the queue pointer
@@ -272,8 +259,6 @@ void *hpQueuePeek(HPriorityQueue *queue) {
272
259
}
273
260
274
261
275
-
276
-
277
262
/** This function will return the number of items in the queue.
278
263
*
279
264
* @param queue the queue pointer
@@ -298,8 +283,6 @@ int hpQueueGetLength(HPriorityQueue *queue) {
298
283
}
299
284
300
285
301
-
302
-
303
286
/** This function will check if the queue is empty or not,
304
287
* and if it was the function will return one (1),
305
288
* other wise it will return zero (0).
@@ -326,8 +309,6 @@ int hpQueueIsEmpty(HPriorityQueue *queue) {
326
309
}
327
310
328
311
329
-
330
-
331
312
/** This function will return a double void array that contains the queue items.
332
313
*
333
314
* Note: the array will be sorted.
@@ -349,7 +330,7 @@ void **hpQueueToArray(HPriorityQueue *queue) {
349
330
350
331
}
351
332
352
- void * * arr = binaryHeapToArray (queue -> heap );
333
+ void * * arr = binaryHeapToArray (queue -> heap );
353
334
354
335
int length = hpQueueGetLength (queue );
355
336
@@ -366,8 +347,6 @@ void **hpQueueToArray(HPriorityQueue *queue) {
366
347
}
367
348
368
349
369
-
370
-
371
350
/** This function will clear the queue and free all it's items,
372
351
* without freeing the queue itself.
373
352
*
@@ -392,8 +371,6 @@ void clearHPQueue(HPriorityQueue *queue) {
392
371
}
393
372
394
373
395
-
396
-
397
374
/** This function will destroy and free the queue and it's items.
398
375
*
399
376
* @param queue the queue pointer
0 commit comments