• Non ci sono risultati.

Algorithm Engineering 8 April 2015

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering 8 April 2015"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering

8 April 2015 1. [rank 3+4+3]

a. Write the pseudo-code of the binary quicksort, and comment on its space occupancy over all recursive calls

b. Show how to reduce the space occupancy of item (a) by changing the pseudo-code

c. Use multi-key quicksort to sort the set of strings S = (apex, zob, bus, bat, zig, bue), by assuming that the pivot-string is chosen as the first one of the string-sequence to be (recursively) sorted.

2. [rank 2+4+3+3] Let us given the set of strings S={aabb, aaabbb, abbbc, abbbd, abbbe, abc}

a. Show the Front-coding compression of S

b. Show the Locality-preserving front-coding compression of S, setting c=1 (for simplicity) and counting previous characters and digits for

“backward copy-check” in the LPFC-algorithm

c. Describe a two-level index that uses in internal memory a Patricia trie on 2 strings

d. Show how it is searched the string “aaabba” in that 2-level index 3. [rank 4] Prove that the height of the skip list is O(log n) with high probability 4. [rank 4] Assume you are given 8 strings (aa, ac, bc, bd, cb, db, dd, de) and you

wish to construct a minimal ordered perfect hash function (MOPHF). Assume that rank(x)=1,2,3,4,5 for the characters x=a,b,c,d,e 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 11 and h2(x’ x’’)

= 1 + rank(x’) + rank(x’’) mod 11 (so m=11). Design a proper g(t) to construct the final h(t), if this is possible given h1 and h2 above.

Riferimenti

Documenti correlati

There- fore an important development of the present work would be represented by the implementation of the developed algorithms on GPU-base hardware, which would allow the

Simulate the behavior of the algorithm MultiKey-Quicksort on the following array of 5 strings S=[bus, bath, abacus, aargh, cat], by assuming that the pivot string is always the

The same authors also showed that it is decidable whether a 1NFT is single-valued (see also [75]), and that equivalence of single-valued 1NFT is decidable [15]. For two-way

Because well over 50% of the world population (with peaks of 80% in Europe, United States, Australia, Canada, and Japan) lives in urban, sub-urban, or semi-urban agglomerates,

[r]

(American Mathematical Monthly, Vol.118, June-July 2011) Proposed by David Beckwith (USA).. The instructions for a magic trick are

The frequency separation between the reference laser and the + laser beam is measured with a Fabry-Perot spectrum analyzer and the ring laser perimeter length is corrected in order

Figure 3.22: Experimental time series showing the presence of a stable upright position together with a stable large amplitude sub-harmonically resonant roll motion for ITACA in