background preloader

ADS Exam 3

Facebook Twitter

Visualizing range trees. Range trees are a data structure which lets you efficiently query a set of points and figure out what points are in some bounding box. They do so by maintaining nested trees: the first level is sorted on the x-coordinate, the second level on the y-coordinate, and so forth. Unfortunately, due to their fractal nature, range trees a bit hard to visualize. (In the higher dimensional case, this is definitely a “Yo dawg, I heard you liked trees, so I put a tree in your tree in your tree in your...”) But we’re going to attempt to visualize them anyway, by taking advantage of the fact that a sorted list is basically the same thing as a balanced binary search tree.

(We’ll also limit ourselves to two-dimensional case for sanity’s sake.) I’ll also describe a nice algorithm for building range trees. Suppose that we have a set of points . Comes from!) So, when we create a range-tree, we first quicksort on the x-coordinate, and then mergesort on the y-coordinate (saving the intermediate results). 13.1 BinaryTrie: A digital search tree. A BinaryTrie encodes a set of bit integers in a binary tree. All leaves in the tree have depth and each integer is encoded as a root-to-leaf path. The path for the integer turns left at level if the th most significant bit of is a 0 and turns right if it is a 1.

. , in which the trie stores the integers 3(0011), 9(1001), 12(1100), and 13(1101). Because the search path for a value depends on the bits of , it will be helpful to name the children of a node, ) and ). ) is the node that comes before in the list and ) is the node that follows in the list. . , is used both before the first node and after the last node in the list (see Section 3.2). Each node, , also contains an additional pointer . 's left child is missing, then points to the smallest leaf in 's subtree. 's right child is missing, then points to the largest leaf in 's subtree. Pointers and the doubly-linked list at the leaves, is shown in Figure 13.2. The operation in a BinaryTrie is fairly straightforward. In the trie. . . The running-time of the time. Growing A Suffix Tree. CS251 "Data Structures and Algorithms" - applet #9 by Alexandru Edgar Ghitza (9630469) and Philippe-Antoine Warda (9632175).

This interactive Java applet allows the user to view the growth of the suffix tree of any given string he enters. This applet has many interesting properties. The nodes in green are the leaves of the suffix tree. As such, they include the index of the particular suffix they contain. This suffix is available by right-clicking on the leaf's node. As an example, if you were to enter the string "GOOGOL" in the text field of the applet and click the ACCEPT bouton, you would notice that the complete suffix tree consists of 9 edges and 10 nodes (7 green leaves and 3 red internal nodes). And here is the source code. GDCB/BCB/ComS 596 Genomic Data Processing.

Suffixtrees.pdf (application/pdf Object) Dis3.pdf (application/pdf Object) Assignment 6 § Bioinformatics Algorithms (Spring 2013)