• Non ci sono risultati.

Algorithm Engineering 12 June 2017

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 12 June 2017"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 12 June 2017

Exercise [rank 6] Given the text T = ASSISI, illustrate the results of each algorithmic step of the pipeline BWT + MTF + RLE1 + Huffman.

Exercise [rank 6] Given the un-directed graph G consisting of 4 vertices and 5 edges {(1,2, 7), (1,4, 1), (1,3, 4), (2,4, 3), (3,4, 2)}, in which the third component indicates the edge weight, show the execution of the Sybein’s algorithm to build the MST fully in external memory.

Exercise [rank 6] Show the encoding of the first 10 positive integers according to the (s,c)-code with s=1 and c=3, hence s+c = 4 = 22 (comment your calculations).

Exercise [rank 5] 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 tables of the second level of a Perfect Hash occupy O(n) average space.

Exercise [rank 3 + 2 + 2] Consider two sets of pairs <key,priority> equal to S1 = {(1,5), (3,2), (4,6)} and S2 = {(3,7), (10,10)}

 insert them into two Treaps (organized as min heaps in their priorities) in the order specified above: so S1 creates Treap T1 and S2 creates Treap T2.

 Then motivate why it is possible to execute a Merge operation between T1 and T2.

 Finally show the execution of a Merge between T1 and T2 (describe the algorithm and show the final result).

Exercise [lode] Describe when the “strange case” of LZW occurs and how it is solved by the decompression algorithm, by providing also a running example.

Riferimenti

Documenti correlati

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

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

 Show the pseudo-code of the variant of binary quicksort that reduces the extra- space used during recursive calls, and comments on its complexity

[rank 5] Describe the Snow Plow algorithm, comment in which sorting algorithm can be used and how it is used, and simulate its working over the sequence 3,8,1,5,1,4,2, and show

Compute the Shortest Path Tree from node a using Dijkstra’s algorithm (showing all steps and used data structures)b. Show how to compute the MST of G in the case of an internal memory

[rank 5] Given the string S=aaccacaacc, show the execution of the Skew algorithm for the first level of recursion, thus solving directly the construction of SA^{2,0}, as done