|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Im quite new to all this and wondered if someone could help me with this question.
If I had a sequence of aaa...aaa, so a, repeated k times. Which string matching encoding scheme LZ77 or LZ78 would encode this more efficiently? and why? |
|
#2
|
||||
|
||||
|
Here's a description of the algorithms: LZ77 LZ78
Although LZW is probably going to give you better compression with repeated data. GIFs use a modified version of this format. And if your data is very redundant, use the RLE format. That'll reduce your example to just a few bytes. Then again, this may be a school question. Which is why you need to look at the links and figure it out for yourself.
__________________
"Science is constructed of facts as a house is of stones. But a collection of facts is no more a science than a heap of stones is a house." - Henri Poincare |
|
#3
|
|||
|
|||
|
I have looked at the basics of these two. But im still not sure which one would be more efficient, any ideas?
|
|
#4
|
||
|
Your example is trivial. The reason that there are multiple compression methods is that some work better for certain data distributions than others. Surely you can appreciate that a page of textual material presents commonalities of one kind while, say, bitmapped images present another. Give me a string of all "a"s, and as Doggie says, I'll compress the bejaysus out of it with RLE.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Software Design > Encoding schemes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|