• Non ci sono risultati.

Algorithm Engineering 29 June 2015 Exercise [rank 5]

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 29 June 2015 Exercise [rank 5]"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

29 June 2015

Exercise [rank 5] Discuss the optimality of the disk striping technique in combination with multi-way mergesort when sorting N items over D disks, in a model with

internal memory of size M and block size B.

Exercise [rank 4+4] Let us given symbols and probabilities: p(a) = 0.25, p(b)=0.25, p(c) = 0.50.

Decompress the first 4 symbols of the Arithmetic coded bit sequence:

1010110.

Indicate the number of bits emitted by Arithmetic coding as a function of the size of the last interval, motivate its choice and prove its correctness.

Exercise [rank 4+4] Consider the Treap data structure:

 Prove that its average height is O(log n), when storing n keys.

 Given a set of pairs <key,priority> equal to {(1,7), (2,2), (3,9), (4,4), (5,3), (6,6), (7,0), (8,1)} insert them into a Treap in that order and then execute a Split operation over the key 5.

Exercise [rank 5+4] Given the graph G formed by the weighted edges E={(a,b,3), (a,d,1), (b,d,4), (b,c,5), (b,e,2), (c,d,1), (c,e,4), (d,e,6)}

 apply the fully external-memory algorithm to compute the MST by never turning into the semi-external version and without applying the initial permuting step on its nodes.

 Compare the solution derived in the previous item with the one obtained by running the Prim’s algorithm, starting from node ‘a’.

Riferimenti

Documenti correlati

Simulate the behavior of the algorithm MultiKey-Quicksort on the following array of 6 strings S=[zoo, horse, bath, abacus, bar, aargh].. Exercise

[r]

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

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 &lt; M, but their total length mL &gt; M (so you cannot explicitly store them in memory), and comment on its