4.4 KiB
title | TARGET DECK | FILE TAGS | tags | ||
---|---|---|---|---|---|
Heaps | Obsidian::STEM | algorithm::data_structure |
|
Overview
The binary heap data structure is an array object that can be viewed as a trees#Positional Trees.
%%ANKI Cloze A binary heap is an {array} that can be viewed as a {binary tree}. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Is the following a valid binary heap? ! Back: Yes. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Is the following a valid binary heap? ! Back: Yes. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Is the following a valid binary heap? ! Back: No. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Why can't the following be a binary heap? ! Back: A heap is equivalently viewed as a complete binary tree. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic What two sizes are associated with binary heaps? Back: The number of valid elements and the size of the underlying array. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic What are the two kinds of binary heaps? Back: Max-heaps and min-heaps. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic What is the max-heap property? Back: Every parent node is greater than or equal to its children in value. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Where is the largest element of a max-heap? Back: At the root. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Where is the smallest element of a max-heap? Back: At the leaves. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic What is the min-heap property? Back: Every parent node is less than or equal to its children in value. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Where is the smallest element of a min-heap? Back: At the root. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic Where is the largest element of a min-heap? Back: At the leaves. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic How is the following binary heap viewed as an array? ! Back: ! Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic How is the following binary heap instead viewed as a binary tree? ! Back: ! Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
%%ANKI Basic What kind of binary heap is the following? ! Back: A max-heap. Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
END%%
Bibliography
- Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).