1 / 11

Average Number of Probes Successful Search

Average Number of Probes Successful Search. A. E. S. C. H. R. Digital Search Example. A 00001 S 1 0011 E 0 0101 R 10 010 C 00 011 H 01 000. Radix Trie Example. A 0000 1 S 10011 E 001 01 R 10010 C 0001 1 H 01 000. H. E. A. C. S. R. i=0; p=root;

yves
Download Presentation

Average Number of Probes Successful Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Average Number of ProbesSuccessful Search

  2. A E S C H R Digital Search Example A 00001 S 10011 E 00101 R 10010 C 00011 H 01000

  3. Radix Trie Example A 00001 S 10011 E 00101 R 10010 C 00011 H 01000 H E A C S R

  4. i=0; p=root; While not inserted if (end of word K reached) set end-of-word marker in p to true else if (p.ptrs[K[i]] == null) create leaf containing K and put its address in p.ptrs[K[i]] else if (refernce p.ptrs[k[i]] refers to a leaf) K_L = key in leaf p.ptrs[K[i]]; do create a non-leaf and put its address in p.ptrs[K[i]] p = the new non-leaf; while (K[i] == K_L[i++]; create a leaf containing K and put its address in p.ptrs[K[--i]] if (end-of-word K reached) set end-of-word marker in p to true else create leaf containing K_L and put address in p.ptrs[K_L[i]] else p = p.ptrs[K[i++]]

  5. Empty Trie Insert “ARA” # A E I P R ARA

  6. # A E I P R ARA # A E I P R P # A E I P R P # A E I P R K_L K ARA AREA Insert “AREA”

  7. # A E I P R Insert “A” P P # A E I P R A # A E I P R ARA AREA

  8. # A E I P R # A E I P R # A E I P R # A E I P R # A E I P R # A E I P R PIER EIRE IPA IRE EERIE A # A E I P R # A E I P R ARA # A E I P R ERA ERIE ERE PEER ARE PEAR PER AREA

  9. A L Radix Tree O ADAM G G E I A N D R LOGGIA LOGGING LOGGED LOGGERHEAD

  10. A L N E A 0 0 0 Patricia Tree 0 4 ADAM I 0 D R 0 0 LOGGIA LOGGING LOGGERHEAD LOGGED

  11. Radix Sort using Counts The Queues can be avoided by using counts. M=2^m, sorting on rightmost w bits: void RadixSort(int a[], int b[], int N) { int i, j, pass, count[M]; for (pass=0; pass < w/m; pass++) { for (j=0; j < M; j++) count[j] = 0; for (i=1; i <= N; i++) count[a[i].bits(pass*m, m)]++; for (j=1; j < M; j++) count[j] = count[j-1] + count[j]; for (i=N; i >= 1; i--) b[count[a[i].bits(pass*m, m)]--] = a[i]; for (i=1; i <= N; i++) a[i] = b[i]; } }

More Related