• Non ci sono risultati.

Algorithm Engineering 16 July 2013 Exercise [rank 2+2+3]

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 16 July 2013 Exercise [rank 2+2+3]"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

16 July 2013 Exercise [rank 2+2+3]

1. Given a text T define what is a suffix array SA for T 2. Show the SA for the text T=abraabba

3. Comment how it is executed the search for P=ra in the SA of item 2 Exercise [rank 3+3]

Given the probabilities p(a)=0.1; p(b)=0.15; p(c)=0.2; p(d)=0.25; p(e)=0.3,

1. Construct the Canonical Huffman code, showing the steps followed by the algorithm.

2. Then use it to decode the bit sequence 1001001, showing each decoding step.

Exercise [rank 2+3+2]

Consider the encoding of a sequence of integers:

1. Define the variable-byte code of an integer x, and specify how many bytes it occupies as a function of the value of x.

2. Define the (s,c)-dense code, where assuming s+c=256, specify how many bytes it occupies to represent integer x as a function of s and c, and comment when it can be better than variable-byte code.

3. Show the (4,4)-dense code for the integer 10. (Here groups are of 3 bits each, since s+c=8.)

Exercise [rank 2+3+2+3]

1. Comment on the space occupancy of the classic quicksort during the recursive calls.

2. Propose a QS-variant which uses O(log n) additional space.

3. Describe the multi-way quicksort for atomic items and compute its I/O complexity by properly setting its parameters.

4. State the main theoretical result at the core of the selection of “k good pivots”, and prove it.

Exercise [rank *]

Prove that the Arithmetic coder achieves nH+2 bits of occupancy.

Riferimenti

Documenti correlati

Write the pseudo-code of the Reservoir Sampling algorithm that random samples m items from a sequence of unknown length. Prove that the probability of extracting any element when

Exercise [rank 4+4] Let us given two arrays: A[1,n] of items and [1,n] that denotes the permutation of the positions in the range [1,n], such that [i] is the position where the

Exercise [rank 2+2] Provide the motivation of introducing Universal Hashing, with respect to classic hash functions (such as mod, division,…) and an example of family of

Prove that the expected reconstruction time of cuckoo hashing is O(n), if it is built over n items and we consider a sequence of a*n insertions, where a is

Discuss the solution, assuming that the distinct items are m < M, but their total length mL > M (so you cannot explicitly store them in memory), and comment on its

2) Indicate whether it would be preferable to have a larger B or a larger M in order to improve the performance of an algorithm, and comment this answer in the light of point

Un'azienda che riceve ordini di acquisto via telefono ha 6 linee telefoniche. Si indichi con Xil numero di linee utilizzate in un dato istante di tempo, e si supponga che

One way of preventing macula detachment during a fluid–air exchange procedure is to drain via a relatively posterior iatrogenic drainage retinotomy (or with a flute needle with a