mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
Add algoritm description
This commit is contained in:
parent
45f09db995
commit
35f6431f47
Binary file not shown.
@ -2,12 +2,21 @@
|
||||
* @file
|
||||
* @author [serturx](https://github.com/serturx/)
|
||||
* @brief Encode a null terminated string using [Run-length encoding](https://en.wikipedia.org/wiki/Run-length_encoding)
|
||||
* @section Description
|
||||
* Run-length encoding is a lossless compression algorithm.
|
||||
* It works by counting the consecutive occurences symbols
|
||||
* and encodes that series of consecutive symbols into the
|
||||
* counted symbol and a number denoting the number of
|
||||
* consecutive occorences.
|
||||
*
|
||||
* For example the string "AAAABBCCD" gets encoded into "4A2B2C1D"
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h> //For printf
|
||||
#include <string.h> //For string functions like strlen
|
||||
#include <stdlib.h> //For malloc/free
|
||||
#include <assert.h> //For assert
|
||||
|
||||
/**
|
||||
* @brief Encodes a null-terminated string using run-length encoding
|
||||
|
Loading…
Reference in New Issue
Block a user