• Non ci sono risultati.

Algorithm Engineering 15 February 2018

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 15 February 2018"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 15 February 2018

Exercise [rank 6]

Describe the Snow Plow algorithm, comment in which sorting algorithm can be used and what is the advantage possibly induced in that sorting algorithm.

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 [rank 5]

Let us given symbols and probabilities: p(a) = 0.5, p(b)=p(c) = 0.25. Decompress the first 4 symbols of the Arithmetic coded bit sequence: 10011.

Exercise [rank 4]

Write the code of the Bounded QuickSort and comment it.

Exercise [rank 5]

Prove that the height of a Skip List built on n items is O(log n) on average.

Exercise [rank 5]

Assume you are given 6 strings (aa, ab, bb, bc, ca, db) and you wish to construct a minimal ordered perfect hash function. Assume that rank(x)=3,4,5,6 for the

characters x=a,b,c,d respectively. Given a string x’x’’ of two characters, we let the two random functions required by the design of MOPHF as h1(x’ x’’) = 3 * rank(x’) * rank(x’’) mod 13 and h2(x’ x’’) = rank(x’) + rank(x’’) mod 13 (so m=13). Design a proper g(t) to construct the final h(t), if this is possible, given h1 and h2 above.

Exercise [rank 5]

Apply the “binary search with exponential jumps” (aka galloping search, or doubling algorithm) to the search of the item 51 within the sorted sequence:

2, 4, 6, 7, 15, 23, 24, 25, 28, 31, 51, 90, 92, 101, 130, 131, 150, 189.

Riferimenti

Documenti correlati

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

Exercise [points 4+4] Given the array A = [5, 2, 4, 8, 3, 1, 9, 6], build the RMQ data structure but ONLY for RMQ-queries which are either aligned to blocks or overlap

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

FederAnziani e Corte di Giustizia hanno tra i loro obiettivi, l’affermazione del ruolo del MMG come cardine del sistema salute; l’umanizzazione del rapporto