• Non ci sono risultati.

Algorithm Engineering 18

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 18"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

18 June 2019 Exercise [rank 4+4]

Describe the difference between compacted trie and patricia trie in terms of space occupancy and time efficiency, as a function of the number of strings, their length and the pattern length.

 Prove that the average depth of the skip list is O(log n)

Exercise [points 2+2+4] Given a sequence of integers S=(1, 6, 15, 18, 21, 24, 30), encode them using:

 Delta code, for each integer

 Rice code with k=3, for each integer

 Elias-Fano code, over the sequence

Exercise [rank 5+3] Let us given the integer array A=[3,8,2,1,9,5,4,15]

 Show how to turn the RangeMinimumQuery (RMQ) problem over A into a RMQ problem over an array B formed by entries +1/-1.

Show how to solve RMQ_A(5,7) by using a data structure built on B that is based on the approach that sparsifies the quadratic table, by indexing only power-of- two-length subsequences [hint: build only the part of the data structure that is used to answer that query].

Exercise [rank 3+3]

 Show a skip list over the set S={1, 5, 7, 9, 10, 11, 15} assuming that the coin tosses where the following ones for each item: 1-HHT, 5-T, 7-HT, 9-HHHHT, 10- HT, 11-HHHT, 15-HHHHHT.

 Show how to search for the item 10 in that skip list

Riferimenti

Documenti correlati

 Show the pseudo-code of the variant of binary quicksort that reduces the extra- space used during recursive calls, and comments on its complexity

Assuming that S is on disk and the Patricia trie is in internal memory, with leaf pointers to strings of S, show the I/O-complexity of prefix- searching for a pattern P[1,p]c. [rank

Exercise [lode] Describe when the “strange case” of LZW occurs and how it is solved by the decompression algorithm, by providing also a

Write the pseudo-code of the algorithm that random samples m items from a sequence of known length n by means of a scanning approach. 2) design an algorithm that solves, via

Write the pseudo-code of the Reservoir Sampling algorithm that random samples m items from a sequence of unknown length. 2) design an algorithm that determines efficiently, via

Exercise [rank 4] Describe the skip list data structure and state its time complexity for searching, inserting or deleting items in a set of size n..  Show a skip list over the

Exercise [rank 6] Prove that the Arithmetic coding algorithm is close to the empirical entropy of a text having length n symbols. Exercise [rank 5] Let us given symbols

 Show the pseudo-code of the variant of binary quicksort that reduces the extra- space used during recursive calls, and comments on its complexity