perlquestion
AlexTape
Omniscient Monks,<br><br>
i meditate about minimizing keys and values in an hash tree.<br><br>
data looks like this<br>
<code>
[a, b, c] => [1, 2, 3]
[b, c] => [2, 3, 4, 5]
[a, c, d] => [4, 5, 6, 7]
[d] => [1, 2, 6]
</code>
basically i got an object containing two lists (e.g. key list and attribute list). now i need an algorithm which is able to reduce needed memory without loosing relations<br>
<br>
the result should look like this:<br>
<code>
[a, b, c, d] => [1, 2]
[a, b, c] => [3]
[a, b, c, d] => [4, 5]
[a, c, d] => [6, 7]
</code>
the problem is that the keys are really short (e.g. A1, A2,...) but the values (1,2,3,..) are really big data strings..<br>
what would be your approach to do it efficient? i know that the simple way is to call the values by reference.. but thats not what i want!<br><br>kindly perlig<br><br>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-893562">
$perlig =~ s/pec/cep/g if 'errors expected';
</div></div>