• Non ci sono risultati.

Algorithm Engineering 16 January 2015

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 16 January 2015"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 16 January 2015

[rank 4] Comment on the correctness of the algorithm that solves in time O(n) the maximum sub-array problem.

[rank 4] Given the string T[1,9]=ddddaabbcc, compute the Canonical Huffman code for the letters of T assuming as probabilities their empirical frequencies in T.

[rank 5] Given the string S=ababca, construct its suffix array via the skew algorithm by showing the encoding of the string s0,2 at just the first iteration. (hint: you must show the string of ranks that would be passed to the recursive call.)

[points 3+2] Given the sequence of keys S = (1, 7, 4, 3, 11, 13, 12) insert them via cuckoo hashing in two tables of size m=5, and hash functions h1(k) = k mod 5, h2(k)

= 3*k mod 5. Comment also on the possibility to insert the key 6.

[points 2+2+4] Given the sequence of strings S = (zoo, bit, aba, bak, bid, bat, zot, man) sort them via MSD-radix sort and via LSD-radix sort.

Finally compare the time complexity of using these two string-sorting algorithms over a set of n strings of length L and English alphabet.

[rank 4] Prove that the average depth of a Randomised Treap built on n keys is O(log n).

Riferimenti

Documenti correlati

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

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

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

Assume you are given 6 strings (aa, ab, bb, bc, ca, db) and you wish to construct a minimal ordered perfect

[r]

So, when A is normal (hermitian) they are in the minimum polygon (real interval) containing the eigenvalues of A.. They are matrices made up of zeros and

[r]