2-3 Search Tree Flashcards
1
Q
What is a 2-3 search tree?
A
Tree that is either empty or
* a 2-node, with one key and two links
* A 3-node with two keys and three links
2
Q
at is
What are the amount of compares for Search and Insert in the worst case?
A
lg N
3
Q
How do we search a 2-3 tree?
A
Self explanitory
4
Q
How do we insert into a 2-node?
A
Replace node with 3 node containing its key and new key to be inserted
5
Q
How do we insert into a 3 node?
A
There are three cases:
* Single 3-node: Create 4 -node, splut into 2-3 tree where middle key is at root.
* 2-node parent: Same as above, move middle up to create a new 3-node
* 3-node parent: Split up into parent, perform operation on parent