# Lec28 - Binary Tries(continued split(k Similar to split algorithm for unbalanced binary search trees Construct S and B on way down the trie Follow

This preview shows pages 1–7. Sign up to view the full content.

Binary Tries (continued) • split(k). • Similar to split algorithm for unbalanced binary search trees. • Construct S and B on way down the trie. • Follow with a backward cleanup pass over the constructed S and B. Forward Pass • Suppose you are at node x, which is at level j of the input trie. a x b • If bit j of k is 1, move to root of b and add a to level j of S and to level j of B.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Forward Pass • If bit j of k is 0, move to root of a and add and b to level j of B to level j of S. a x b Forward Pass Example b a c d e f g S = null B = null k = g.key = 101011
Forward Pass Example b c d e f g a S B k = g.key = 101011 Forward Pass Example c d e f g B b a S k = g.key = 101011

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Forward Pass Example d e f g a S c b B k = g.key = 101011 Forward Pass Example c a S d b B e f g k = g.key = 101011
Forward Pass Example f g c a S e d b B k = g.key = 101011 k = g.key = 101011 Forward Pass Example d b B e c a S f

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Backward Cleanup Pass • Retrace path from current nodes in S and B toward roots of respective tries. • Eliminate branch nodes that are roots of
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/22/2012 for the course CSE 3101 taught by Professor Shani during the Fall '10 term at University of Florida.

### Page1 / 18

Lec28 - Binary Tries(continued split(k Similar to split algorithm for unbalanced binary search trees Construct S and B on way down the trie Follow

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online