Run-Length Encoding
المؤلف:
المرجع الالكتروني للمعلوماتيه
المصدر:
www.almerja.com
الجزء والصفحة:
...
31-3-2021
2409
Run-Length Encoding
A specification of elements in a list as a list of pairs giving the element and number of times it occurs in a run. For example, given the list
{1,1,1,3,3,6,6,6,2,2,2,2,3,3,1,4,4}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline1.gif" style="height:15px; width:257px" />, the run-length encoding is
{" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline2.gif" style="height:15px; width:5px" />
{1,3}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline3.gif" style="height:15px; width:32px" />,
{3,2}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline4.gif" style="height:15px; width:32px" />,
{6,3}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline5.gif" style="height:15px; width:32px" />,
{2,4}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline6.gif" style="height:15px; width:32px" />,
{3,2}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline7.gif" style="height:15px; width:32px" />,
{1,1}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline8.gif" style="height:15px; width:32px" />,
{4,2}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline9.gif" style="height:15px; width:32px" />
}" src="https://mathworld.wolfram.com/images/equations/Run-LengthEncoding/Inline10.gif" style="height:15px; width:5px" />. Run-length encoding can be implemented in the Wolfram Language as:
RunLengthEncode[x_List] :=
{First[#], Length[#]}& /@ Split[x]
الاكثر قراءة في الاحتمالات و الاحصاء
اخر الاخبار
اخبار العتبة العباسية المقدسة