Digital Search Trees - Advanced Data Structures - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Advanced Data Structures which includes Split Algorithm, Unbalanced Binary Search Trees, Forward Pass, Forward Pass Example, Backward Cleanup Pass, Retrace Path, Current Nodes, Roots of Respective Tries, Branch Nodes etc. Key important points are: Digital Search Trees, Binary Tries, Analog of Radix Sort, Binary Bit Strings, Packet Classification, Complexity of Operation, Information Retrieval, Comparison Per Operation, Fixed Length Keys

Typology: Slides

2012/2013
On special offer
30 Points
Discount

Limited-time offer


Uploaded on 03/19/2013

dharmakeerti
dharmakeerti ๐Ÿ‡ฎ๐Ÿ‡ณ

4.2

(27)

89 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Digital Search Trees & Binary Tries
โ€ขAnalog of radix sort to searching.
โ€ขKeys are binary bit strings.
๎šƒFixed length โ€“ 0110, 0010, 1010, 1011.
๎šƒVariable length โ€“ 01, 00, 101, 1011.
โ€ขApplication โ€“ IP routing, packet classification,
firewalls.
๎šƒIPv4 โ€“ 32 bit IP address.
๎šƒIPv6 โ€“ 128 bit IP address.
Digital Search Tree
โ€ขAssume fixed number of bits.
โ€ขNot empty =>
๎šƒRoot contains one dictionary pair (any pair).
๎šƒAll remaining pairs whose key begins with a 0
are in the left subtree.
๎šƒAll remaining pairs whose key begins with a 1
are in the right subtree.
๎šƒLeft and right subtrees are digital search trees
on remaining bits.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
Discount

On special offer

Partial preview of the text

Download Digital Search Trees - Advanced Data Structures - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

1

Digital Search Trees & Binary Tries

  • Analog of radix sort to searching.
  • Keys are binary bit strings. ยƒ Fixed length โ€“ 0110, 0010, 1010, 1011. ยƒ Variable length โ€“ 01, 00, 101, 1011.
  • Application โ€“ IP routing, packet classification,firewalls. ยƒ ยƒ IPv4 โ€“ 32 bit IP address.IPv6 โ€“ 128 bit IP address.

Digital Search Tree

  • Assume fixed number of bits.
  • Not empty ยƒ Root contains one dictionary pair (any pair). => ยƒ All remaining pairs whose key begins with a are in the left subtree. 0 ยƒ All remaining pairs whose key begins with a are in the right subtree. 1 ยƒ Left and right subtrees are digital search treeson remaining bits.

2

Example

  • Start with an empty digital search tree andinsert a pair whose key is 0110. 0110
  • Now, insert a pair whose key is 0010. 0110 0010

Example

  • Now, insert a pair whose key is 1001. 0110 (^0010 )

4

Search/Insert/Delete

  • Complexity of each operation is O(#bits in a key).
  • #key comparisons = O(height).
  • Expensive when keys are very long.

Binary Trie

  • Information Retrieval.
  • At most one key comparison per operation.
  • Fixed length keys. ยƒ Branch nodes.
    • Left and right child pointers.โ€ข No data field(s). ยƒ Element nodes.โ€ข No child pointers.
  • Data field to hold dictionary pair.

5

Example

At most one key comparison for a search.

Variable Key Length

  • Left and right child fields.
  • Left and right pair fields. ยƒ Left pair is pair whose key terminates at root of left subtree or the single pair that mightotherwise be in the left subtree. ยƒ Right pair is pair whose key terminates at rootof right subtree or the single pair that might ยƒ otherwise be in the right subtree.Field is null otherwise.

7

Fixed Length Insert

Insert 1101.

Fixed Length Insert

Insert 1101.

8

Fixed Length Insert

Insert 1101.

One compare.

Fixed Length Delete

Delete 0111.

10

Fixed Length Delete

Delete 1100.

Fixed Length Delete

Delete 1100.

11

Fixed Length Delete

Delete 1100.

Fixed Length Delete

Delete 1100. One compare.

13

Fixed Length Join(S,m,B)

  • S has nonempty right subtree.
  • Left subtree ofall keys in Bโ€™ > Bโ€™ all keys in must be empty, because S.

c

Bโ€™

a

J(S,Bโ€™)

a J(b,c)

S

b

Complexity = O(height).