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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Backward Cleanup Pass • Retrace path from current nodes in S and B toward roots of respective tries. • Eliminate branch nodes that are roots of
Background image of page 6
Image of page 7
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 Right Arrow Icon
Ask a homework question - tutors are online