/* Binary_heap.h -- binary heap file */<br/> # include "new_adjacenty_list.h" </P> <p>/* data type definition */</P> <p> typedef vertex * heap_item; <br/> typedef struct binary_heap <br/>{< br/> heap_item * heap; <br/> int capacity; <br/> int current; <br/>}* binary_heap; </P> <p>/* interface function declaration */</P> <p>/* operation: before creating and initializing a binary heap */<br/>/*: PBH points to a binary heap. capacity indicates the size of the heap */<br/>: if capacity> 0 & memory allocation is successful, 1 is returned if the heap is created; otherwise 0 */<br/>/* time complexity: O (1) */<br/> int initialize_ B (binary_heap * const PBH, const int capacity); </P> <p>/* operation: add a data field to the heap as the specified data element */<br/>/* before the operation: PBH points to an initialized binary heap, hi is the specified data to be added */<br/>/*: If the heap is not full, add a new element to the binary heap and return 1; otherwise, 0 */<br/>/* time complexity is returned: O (log n) */<br/> int insert_ B (const binary_heap * const PBH, const heap_item hi ); </P> <p>/* operation: delete and return the smallest element in the heap */<br/>/* before the operation: PBH points to an initialized binary heap */<br/>/*: If the heap is not empty, delete the minimum element in the heap and return it; otherwise, the system returns the dummy element */<br/>/* time complexity: O (log n) */<br/> heap_item deletemin_ B (const binary_heap * const PBH ); </P> <p>/* operation: before the operation, increase the value of the DIST field of the specified Element in the heap */<br/>: PHB points to an initialized binary heap. index indicates the index of the specified element, and triangle indicates the size of Delta */<br/>/* after the operation: if the heap is not empty & index is a valid index & △> = 0, the DIST field of the element whose index is indexed in the heap is increased by △, and 1 is returned; otherwise, 0 */<br/>/* time complexity is returned: O (log n) */<br/> int increasekey_ B (const binary_heap * const PBH, const int index, const int triangle); </P> <p>/* operation: before performing any operation to reduce the DIST field value of the specified Element in the heap */<br/>: PBH points to an initialized binary heap, index indicates the index of the specified element, and triangle indicates the size of Delta */<br/>/* after the operation: if the heap is not empty & index is a valid index & △> = 0, the DIST field of the element whose index is indexed in the heap is reduced by △, and 1 is returned; otherwise, 0 */<br/>/* time complexity is returned: O (log n) */<br/> int decreasekey_ B (const binary_heap * const PBH, const int index, const int triangle); </P> <p>/* operation: Release the memory space occupied by a binary heap */<br/>/* operation: PBH points to an initialized binary heap */<br/>/*: the memory occupied by the heap is released */<br/>/* time complexity: O (1) */<br/> void release_ B (const binary_heap * const PBH );