• Non ci sono risultati.

Algorithm Engineering 16 December 2020 – time 45 minutes

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 16 December 2020 – time 45 minutes"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

16 December 2020 – time 45 minutes

Question #1 [ranks 4+5]. Construct a Treap by inserting in the given order the

following sequence of pairs: <10,1>, <5,3>, <20,3>, <15,4>, <30,6>, <12,6>, <17,10>, use a MIN-heap over the y-coordinate (i.e. the priority). The x-coordinate is the key.

a. Show the final Treap

b. Show the rotations induced by the insertion of the pair <13,2>, and the final Treap so obtained.

Question #2 [ranks 5]. Simulate the Reservoir algorithm by drawing m=2 items from a sequence of length n=6: [a, b, c, d, e, f], and assuming that at every step the

random integers extracted by the algorithm are [3, 1, 4, 2].

Question #3 [ranks 3+3]. Given the symbols {a,b,c,d,e,f,g} occurring in a text with frequencies f(a) = f(d) = f(e) = f(f) = 0.1, f(b) = 0.28, f(c) = 0.11, f(g)= 0.21.

• Compute FC[] and SYMB[] tables of the Canonical Huffman code

• Decode the first 2 symbols of the compressed sequence: 11001….

Question #4 [ranks 5]. Given: p(a) = 1/8, p(b) = ¼, p(c) = 5/8. Specify which is the length in bits of the text T = aabbaa, if it is compressed via Arithmetic coding. (Hint:

work with negative powers of two.)

Question #5 [rank 5]. Given the binary strings S={aaaaa, aacaaaa, aacaaba, bb}.

Build the Patricia Tree for S and show how to search for the lexicographic position of the string P=aacbba among the strings of the set S.

Riferimenti

Documenti correlati

This result strongly suggests that we are observing discrete shifts from part-time to full-time work, as conjectured by Zabalza et al 1980 and Baker and Benjamin 1999, rather

Missense mutations: refer to a change in one amino acid in a protein, arising from a point mutation in a single nucleotide. In AKU there are more than 100 different missense

 Create a classification model based on the logistic regression algorithm for textual documents..  Apply the model to new

Prove that the probability of having a 0 in a position of the binary array of the Bloom Filter is ½, when the number of hash functions is set to the optimal one.. (hint: derive

Simulate the behavior of the algorithm MultiKey-Quicksort on the following array of 5 strings S=[bus, bath, abacus, aargh, cat], by assuming that the pivot string is always the

• Design a two-level storage scheme for S in which each disk page stores two strings which are Front-compressed, and the strings in internal memory are indexed via

Compress the text “AC” via Arithmetic coding, using ratios to make computations, and emitting the final sequence of bits.. You are given the graph below, in which the bold

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,