Editing Binomial heap

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 89: Line 89:
 
* A node in a binomial tree can have more than two children.
 
* A node in a binomial tree can have more than two children.
 
* Binomial trees are fully max-heap-ordered, rather than simply left-max-heap-ordered like power-of-two trees.
 
* Binomial trees are fully max-heap-ordered, rather than simply left-max-heap-ordered like power-of-two trees.
A binomial tree of height 0 is a single node. A binomial tree of height <math>k > 0</math> consists of a root node with <math>k</math> children. One of these children is the root of a binomial tree with height 0, one is the root of a binomial tree with height 1, and so on up to <math>k-1</math>.
+
A binomial tree of height 0 is a single node. A binomial tree of height <math>k > 0</math> consists of a root node with <math>k</math> children. The subtree rooted at each child is a tree of a different height.
 
When we merge two binomial trees of the same size, we simply make the smaller root the child of the larger root. Observe that this instantly gives a binomial tree of twice the size (whose height is then one greater than the heights of the two original trees). When we split a binomial tree of height <math>k > 0</math>, we simply detach the subtree of height <math>k-1</math>, giving two binomial trees of size <math>k-1</math>.
 
When we merge two binomial trees of the same size, we simply make the smaller root the child of the larger root. Observe that this instantly gives a binomial tree of twice the size (whose height is then one greater than the heights of the two original trees). When we split a binomial tree of height <math>k > 0</math>, we simply detach the subtree of height <math>k-1</math>, giving two binomial trees of size <math>k-1</math>.
  

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)

Templates used on this page: