Last chance! 50% off unlimited learning
Sale ends in
Implements the max-heapify process to create the heap. This function is for internal
use and is called by the dcem_star_cluster_uv
(univariate data) and
dcem_star_cluster_mv
(multivariate data).
max_heapify(data, index, N)
(dataframe): The dataframe containing the key, value pairs.
(numeric): Index of the node.
(numeric): Size of the heap.
data frame: The data frame containing the heap.
Using data to build a better EM: EM* for big data.
Hasan Kurban, Mark Jenne, Mehmet M. Dalkilic (2016) <doi:https://doi.org/10.1007/s41060-017-0062-1>.
# NOT RUN {
# Create a sample data frame
heap <- data.frame(keys=c(0,3,4,5), vals=c(7,7,4,6))
# Build the heap from the data frame.
heap <- build_heap(heap)
# Call max-heapify untill the last node
i = floor(nrow(heap)/2)
while (i>=1){
heap = max_heapify(heap, i, nrow(heap))
i = i-1
}
# }
Run the code above in your browser using DataLab