yep Flashcards
What are the properties of red-black trees?
- Every node must be black or red.
- The root MUST be black
- If a node is red, its children must be black.
- Every leaf is NULL and both its children are black.
- All simple paths from the node to descendant leaves contain the same number of BLACK nodes.
What is a complete binary tree?
binary tree such that every level of the tree has the maximum of nodes possible expect for the leaf level (deepest level)
What is a full binary tree?
All leaves have the same depth and every nonleaf node has two children
What are 2-3-4 trees?
self balance trees, internal nodes can have 2,3, or 4 children (1,2,3 elements or keys), with leaf nodes in sorted order,
How would you convert a 2-3-4 tree to a red black tree?
2- node is just a black node. 3nodes is a black node with red child. 4 node is a black node with 2 red children.
What are b tree’s?
node’s contaning multiple keys that ensure each node has min num of keys. max num of elements is twice the min. every leaf in a B tree MUST have same height/depth (balancing)
What are invariants in hashing, and why are they important?
properties or rules that remain unchanged during the execution of hashing algorithms.