remove adjacent duplicates Algorithm

Whereas compression algorithms identify redundant data inside individual files and encodes this redundant data more efficiently, the intent of deduplication is to scrutinize large volumes of data and identify large sections – such as entire files or large sections of files – that are identical, and replace them with a shared copy. Deduplication is often paired with data compression for additional storage saving: Deduplication is first used to eliminate large chunks of repetitive data, and compression is then used to efficiently encode each of the stored chunks.

remove adjacent duplicates source code, pseudocode and analysis