Tries - Tries 9:02 AM Outline and Reading Standard...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
4/1/2003 9:02 AM Tries 1 Tries e nimize nimize ze ze i mi mize nimize ze 4/1/2003 9:02 AM Tries 2 Outline and Reading Standard tries (§11.3.1) Compressed tries (§11.3.2) Suffix tries (§11.3.3) Huffman encoding tries (§11.4.1) 4/1/2003 9:02 AM Tries 3 Preprocessing Strings Preprocessing the pattern speeds up pattern matching queries After preprocessing the pattern, KMP’s algorithm performs pattern matching in time proportional to the text size If the text is large, immutable and searched for often (e.g., works by Shakespeare), we may want to preprocess the text instead of the pattern A trie is a compact data structure for representing a set of strings, such as all the words in a text A tries supports pattern matching queries in time proportional to the pattern size 4/1/2003 9:02 AM Tries 4 Standard Trie (1) The standard trie for a set of strings S is an ordered tree such that: Each node but the root is labeled with a character The children of a node are alphabetically ordered The paths from the external nodes to the root yield the strings of S Example: standard trie for the set of strings S = { bear, bell, bid, bull, buy, sell, stock, stop } a e b r l l s u l l y e t l l o c k p i d 4/1/2003 9:02 AM Tries 5 Standard Trie (2) A standard trie uses O ( n )
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern