For input such as
00000001111111111111100000000000001111111111110000000

Can be written as:
0 7 14 14 12 7

The first character determines the the first character in the original
sequence.
Since there are only two possible values 0 and 1
the above should be read as

7 times 0 then 14 times 1 then 14 times 0 then 12 times 1 then 7 times 0
(i.e alternate the bit pattern after each value)

The worst case will occur when pattern alternates at each step i.e

01010101010

In this case answer will be

0 1 1 1 1 1 1 1 1 1 1 1

Total space required will be of the order of the space required by the
previous sequence about 2*size of original input.

Is this correct?






On Fri, Nov 5, 2010 at 12:20 AM, neeraj agarwal
<[email protected]>wrote:

> here i don't think huffman will work.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to