Hi,



in a weighted sequence each element is assigned a positive integer weight 
(1,2,3,...). Adding an element of weight n has an effect similar to adding 
the same element n-times. For example, consider a sequence s=[a/3,b/2,c/1] 
(first element is a with weight 3, second element is b with weight 2, third 
element is c with weight 1]. Indexing the sequnece gives the results s[0]=a,
s[1]=a, s[2]=a, s[3]=b, s[4]=b, s[5]=c.




For example in a text editor if you stored the text as a list of lines, you 
could add each line as an element to a sequence giving it the weight equal 
to the number of bytes in that line. Then, s[i] would give you the line 
which has the i-th byte in the file (and it would also give you the 
'remainder'/offset into that line.




Does that make more sense?




Cheers

-Jiri








---------- Původní zpráva ----------
Od: Jakub Jermar <[email protected]>
Datum: 19. 11. 2012
Předmět: Re: [HelenOS-devel] Index sequence ADT enhancement

"Hi Jiri,

On 16.11.2012 16:30, Jiří Královec wrote:
> I would like to contribute to HelenOS by implementing an enhancement
> proposed in the ticket #438 named "Indexed sequence ADT"
> in the HelenOS's Trac (http://trac.helenos.org/ticket/438
(http://trac.helenos.org/ticket/438)).
> 
> The problem is that I don't understand what exactly is meant by
> the term "Weighted indexed sequence" even though the ticket's
> description try's to explain it.
> I understand what the "Indexed sequence" means, but I'm not
> sure what exactly "Weighted" adds to it.

Thanks for your interest in HelenOS.

If there are some doubts in relation to this ticket, it would be best to
get the answer from its author - JiriS.

I have no idea what weighted means in this context. It would usually
mean the the individual elements have different weights (i.e. contribute
by different weight to a sum or a product), but not sure what it can
mean in this context. Could it be that an element with a greater weight
gets some indexing advantage, such as it will be found faster in the
index? JiriS?

Jakub


_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
(http://lists.modry.cz/cgi-bin/listinfo/helenos-devel)"
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to