• Non ci sono risultati.

Algorithm Engineering 4 September 2018

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 4 September 2018"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

4 September 2018

1. [rank 2+3+3+3]Let us given the binary strings S = {0001100, 0001110, 0011, 0010, 101, 111}.

a. Show the compacted trie for S.

b. Show the Patricia trie for S.

c. Assuming that S is on disk and the compacted trie is in internal

memory, with edge labels implemented via pointers to substrings of S, show the I/O-complexity of prefix-searching for a pattern P[1,p].

d. 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].

2. [rank 5] Describe the algorithm MultiKey-Quicksort, specify its time

complexity, and finally show its behavior on the following array of 8 strings S=[zoo, zorro, boa, battle, abi, box, zio, hit] by executing just the first

partitioning step.

3. [rank 3+3+3] Let us given the symbols and their probabilities: p(a) = p(b) = 0.1, p(c)= 0.2, p(d)=p(e)=0.11, p(f)=0.38.

a. Compute the Huffman code for this distribution.

b. Compute the Canonical variant of the Huffman code, indicating how do you compute the canonical codewords.

c. Decode the first 3 symbols of the coded sequence 10001011011100…

4. [rank 5] Describe the Perfect Hash Table for a set of n keys S, and prove that it takes O(n) space on average.

Riferimenti

Documenti correlati

[r]

Arbitrage, de Finetti’s coherence principle, equivalent martingale measure, finitely additive probability, fundamental theorem of asset

Find all points of maximum and all points

NOTE: In the solution of a given exercise you must (briefly) explain the line of your argument and show the main points of your calculations1. Solutions without adequate

In fact, knowing what the shape of the canonical form will be (see the textbook, or simply the text of the present exercise), from the fact that for x + y − z + 2t = 0 (which defines

Let a, b, and c be the lengths of the sides of a triangle, and let R and r be the circumradius and inradius of the

Answer: As a basis of Im A, take the first, fourth and fifth columns, so that A has rank 3. Find a basis of the kernel of A and show that it really is a basis... Does the union of

If S is not a linearly independent set of vectors, remove as many vectors as necessary to find a basis of its linear span and write the remaining vectors in S as a linear combination