• Non ci sono risultati.

Algorithm Engineering 5 September 2017 First and Last Name: Matricola:

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 5 September 2017 First and Last Name: Matricola:"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering 5 September 2017

First and Last Name: Matricola:

Exercise 1 [rank 4+2] Given the undirected and weighted graph

G={ (A,B, 2), (A,F, 4), (A,E, 6), (B,C, 1), (B,F, 3), (C,D, 3), (C,F, 5) }.

compute the MST via the PRIM’s algorithm by detailing the use of its data structures and starting from the root-node A.

discuss the efficiency of PRIM’s algorithm when the graph grows in size (i.e. as a function of m and n).

Exercise 2 [rank 8] Given the string S = “amaca$” show the result of the compression via the algorithmic pipeline BWT + MTF + RLE1 + Huffman. Assume that MTF counts symbol positions from 1.

Exercise 3 [rank 4+3] Construct two (maximum-priority) treaps: T1 contains the set of pairs <key,priority> equal to { (1,7), (2,2), (3,9), (4,4) } and T2 contains the set of pairs <key,priority> equal to { (5,3), (6,6), (7,0), (8,1) }.

Then show how to merge T1 with T2.

Exercise 4 [rank 3] Prove that in an undirected cuckoo graph of r nodes and n edges, the probability that two nodes are connected by a path of length L is at most

c^{-L}/r, when r ≥ 2cn.

Exercise 5 [rank 3+3] Given the string S=annapanna, compute its parsing LZ77 and LZ78.

Riferimenti

Documenti correlati

[r]

Assuming that S is on disk and the Patricia trie is in internal memory, with leaf pointers to strings of S, show the I/O-complexity of prefix- searching for a pattern P[1,p]c. [rank

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 4] Describe the skip list data structure and state its time complexity for searching, inserting or deleting items in a set of size n..  Show a skip list over the

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 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

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