• Non ci sono risultati.

Algorithm Engineering 15 January 2018

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 15 January 2018"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 15 January 2018

Exercise [rank 4]

What is Disk Striping, why it has been introduced, which is its I/O-complexity, and finally compare it against the I/O-optimal lower bound to sort n items in a disk- memory having page size B and internal memory M.

Exercise [rank 4]

Prove that the output of the Arithmetic coding algorithm is close to the empirical entropy of a text having length n symbols.

Exercise [rank 5+5]

Given a text consisting of the symbols {a,b,c,d,e,f,g} occurring with frequency f(a) = f(b) = f(d) = f(e) = 0.1, f(c) = 0.11, f(f)= 0.21, f(g) = 0.28.

 Compute the Canonical Huffman code for those 7 symbols.

 Decode the first 3 symbols of compressed sequence: 00110101011011100….

Exercise [rank 2+4]

Assume you are given a (S,C)-dense code over 3 bits, with S=5 and C=3.

Infer, via the formulas about (S,C)-dense codes, how many bits are needed for the 13th codeword.

Show the 13th codeword.

Exercise [rank 3+3]

Consider the pairs <key,priority>: {(4,7), (2,2), (3,9), (8,4), (1,3), (6,6), (7,0)}.

 Show the Treap that contains them.

 Show the operations induced by the insertion of (10,1) in the previous Treap.

Riferimenti

Documenti correlati

Prove that, for any pair of positions i and j in the cuckoo table, the probability that the shortest path connecting ij has length L is c^{-L}/r, where r is the number of

 Recompute the average length of the sorted runs if the Snow Plow is executed over a sequence in which the probability of an item to go in the heap is 2/3 instead of 1/2.  Show

Build a Patricia trie on the set of strings S={aba, abcaba, abcad, bd} and show how it is executed a lexicographic search for the string P1 = acdac,

Exercise [rank 5] Given the string S=baobab, compute the Suffix Array, and then derive the LCP array by using the linear-time algorithm seen in class, showing the amount of

Finally simulate its working over the sequence 3,10,1,6,2,5,3, by showing the sorted blocks it forms with a memory capable to store M=2 integers.. Exercise

 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 [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