• Non ci sono risultati.

Algorithm Engineering 12 January 2017

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 12 January 2017"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 12 January 2017

Exercise [rank 3] Specify and motivate the I/O-complexity of the disk striping

technique and then compare it against the I/O-optimal lower bound to sort n items in a disk-memory having page size B and internal memory M.

Exercise [rank 6] Prove that the Arithmetic coding algorithm is close to the empirical entropy of a text having length n symbols.

Exercise [rank 5] Let us given symbols and probabilities: p(a) = 0.25, p(b)=0.25, p(c) = 0.50. Compress via Arithmetic coding the text ABCC.

Exercise [rank 6] Let H be a class of Universal Hash functions h: U -> {0,1,2,...,m-1}

and let S be a subset of U formed by n keys. Prove that, if h is drawn randomly from H, then the average number of collisions induced by h onto the keys of S is upper bounded by n^2/(2*m). [Comment the formulas you write]

Exercise [rank 5] Given the graph G = {(a,b) (a,d) (b,c) (c,a) (c,e) (d,b) (d,e) (e,c) }

 Perform a DFS visit of G, specifying the edges and nodes in the order they are visited (assume that the adjacency list of each node is sorted by destination- node label).

Build the MST of G (assumed undirected) via Kruskal’s algorithm, assuming that the weight of the edge (x,y) is computed as 2 * rank(x) * rank(y) mod 7, and rank(x) is the rank in the alphabet of the letter x or y, counting from 2.

Exercise [rank 5] Consider 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 (as min heap) in that order and then execute a Split operation over the key 6.

Exercise [lode] Does it change the length of the text ABCC compressed via Arithmetic coding if we permute its letters? Motivate the answer.

Riferimenti

Documenti correlati

 Infer, via the formulas about (S,C)-dense codes, how many bits are needed for the

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 [lode] Describe when the “strange case” of LZW occurs and how it is solved by the decompression algorithm, by providing also a

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

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

[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

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