Jump to content

Time for compression?


fredreload

Recommended Posts

Use a really slow computer. :)

 

There are quite a few compression algorithms that are asymmetric. For example, many video compression algorithms cannot be compressed in real time (or need specialised hardware to do so (1) ) but must (by definition) be decompressed in real time. The compression algorithm will do fairly complex image analysis to find parts of the image that have moved and then encode that as a vector ("this block of pixels has moved by dx, dy"). The decoder just needs to copy a block of pixels without any real "intelligence".

 

(1) Or, at least, they did back in the day, when I was involved in such systems. Several racks of noisy hardware to do the compression. A cheap embedded processor to do the decode.

Link to comment
Share on other sites

Alright I got a question, assuming you have an array, 67142 that is sorted into 12467 from Bubble sort, how do you get the original sequence 67142 from 12467? Can you reverse run the program?

 

P.S. Wait never mind problem solved, beat that Strange :D, you need to know how many pass you've ran though https://en.wikipedia.org/wiki/Bubble_sort

Edited by fredreload
Link to comment
Share on other sites

You would, I assume, also need to know what values were swapped at each pass. There is, in general, no algorithm for reversing a sort other than either recording the original order or recording what was done at each step of the sort.

 

But well done for choosing a bubble sort if you want a slow algorithm. :)

(Although it is one of the fastest algorithms on some parallel architectures.)

Link to comment
Share on other sites

You would, I assume, also need to know what values were swapped at each pass. There is, in general, no algorithm for reversing a sort other than either recording the original order or recording what was done at each step of the sort.

 

But well done for choosing a bubble sort if you want a slow algorithm. :)

(Although it is one of the fastest algorithms on some parallel architectures.)

Thanks man, you are awesome, sorry about the challenge I made, I might have to start my calculation right after Big Bang, well, reversing is my specialty :P

 

P.S. This is one of a few sorts I can do correctly in an exam

Edited by fredreload
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.