Create a min/max heap where elements are in the range (0, size - 1) and shuffled before heapify.
(size, heap_kind)
| 222 | |
| 223 | @staticmethod |
| 224 | def create_heap(size, heap_kind): |
| 225 | """ |
| 226 | Create a min/max heap where elements are in the range (0, size - 1) and |
| 227 | shuffled before heapify. |
| 228 | """ |
| 229 | heap = list(range(OBJECT_COUNT)) |
| 230 | shuffle(heap) |
| 231 | if heap_kind == Heap.MIN: |
| 232 | heapq.heapify(heap) |
| 233 | else: |
| 234 | heapq.heapify_max(heap) |
| 235 | |
| 236 | return heap |
| 237 | |
| 238 | @staticmethod |
| 239 | def create_random_list(a, b, size): |
no test coverage detected