Discussion:
Zero Node Code!
(too old to reply)
t3h j1mb0
2005-10-02 20:04:21 UTC
Permalink
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
Zach
2005-10-02 21:09:35 UTC
Permalink
Post by t3h j1mb0
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
I believe it means that the encoder will output the character when it
hits the zero node.

When the decoder is decoding a string of bits and it runs into the zero
node, then it is assumed that the next 32 bits contain the character
code to be inserted into the tree.
Zach
2005-10-02 21:12:11 UTC
Permalink
Post by Zach
node, then it is assumed that the next 32 bits contain the character
I mean 1 byte (8 bits). Oops
Jamie Hargrove
2005-10-02 21:03:38 UTC
Permalink
User-Agent: OSXnews .10/b
Xref: number1.nntp.dca.giganews.com utexas.class.cs337:327

In message <dhpegd$mso$***@geraldo.cc.utexas.edu>
t3h j1mb0 <***@mail.utexas.edu> wrote:

The code in question needs to specify what symbol/byte we are encoding
that isn't in the tree yet. The simplest "code" to use would probably be
just writing the byte in question to the file. Of course, I'm still
trying to figure out the existing code we've been given and what we're
supposed to do, so this may or may not be how we're supposed to handle
this.-Jamie
Post by t3h j1mb0
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
.
Luke Robison
2005-10-02 16:12:05 UTC
Permalink
Post by Jamie Hargrove
The code in question needs to specify what symbol/byte we are encoding
that isn't in the tree yet. The simplest "code" to use would probably be
just writing the byte in question to the file. Of course, I'm still
trying to figure out the existing code we've been given and what we're
supposed to do, so this may or may not be how we're supposed to handle
this.-Jamie
Post by t3h j1mb0
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
.
Jamie correctly described the encoding, but the confusing part is that
the "output a code" comment is in the DEcode function. I have assumed
that what he means is to read in the code and add it to our tree. I can
make no other sence out of it. anyone else confused?
-Luke
Somik Behera
2005-10-02 21:35:20 UTC
Permalink
yeah, i am still confused on this. especially since my program does the
compress but runs out of memory while trying to decompress.The other
methods are a sort of clear, so I am thinking the problem lies in my
understanding of decodeOptAdaptive().

Any clarification on how to approach decodeOptAdaptive() would be helpful.

Thanks,

somik
Post by Jamie Hargrove
The code in question needs to specify what symbol/byte we are encoding
that isn't in the tree yet. The simplest "code" to use would probably be
just writing the byte in question to the file. Of course, I'm still
trying to figure out the existing code we've been given and what we're
supposed to do, so this may or may not be how we're supposed to handle
this.-Jamie
Post by t3h j1mb0
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
.
Jamie correctly described the encoding, but the confusing part is that the
"output a code" comment is in the DEcode function. I have assumed that what
he means is to read in the code and add it to our tree. I can make no other
sence out of it. anyone else confused?
-Luke
Jamie Hargrove
2005-10-03 05:13:52 UTC
Permalink
User-Agent: OSXnews .10/b
Xref: number1.nntp.dca.giganews.com utexas.class.cs337:380
Post by Luke Robison
Post by Jamie Hargrove
The code in question needs to specify what symbol/byte we are encoding
that isn't in the tree yet. The simplest "code" to use would probably be
just writing the byte in question to the file. Of course, I'm still
trying to figure out the existing code we've been given and what we're
supposed to do, so this may or may not be how we're supposed to handle
this.-Jamie
Post by t3h j1mb0
In the decodeOptAdaptive method, the pseudocode says to output a code if
we output the zero node. What does that mean?
-Jimbo
.
Jamie correctly described the encoding, but the confusing part is that
the "output a code" comment is in the DEcode function. I have assumed
that what he means is to read in the code and add it to our tree. I can
make no other sence out of it. anyone else confused?
-Luke
.
That was my assumption as to the meaning.
Jamie

Loading...