Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help! I have no idea where to start or how to do RLE. Program 2: Easy RLE Intro to Programming in C Assignment: Design

image text in transcribed Please help! I have no idea where to start or how to do RLE.
Program 2: Easy RLE Intro to Programming in C Assignment: Design and implement a program that encodes a sequence of integers using a simple compression scheme I am calling easy run length encoding. Run length encoding is a process where sequences of duplicate numbers are stripped from the data and replaced with a flag indicating an encoded sequence follows, the number of duplicate values in the original sequence (called the length), and the duplicated value. For easy RLE we will be combining the flag and the length into one number; easy RLE represents the start of a sequence of length n with the value -n. As an example, let's say that the data were are encoding is 10 15 20 14 14 1414 65 20 20 20 10 8; that sequence of values would be encoded in easy RLE as 10 15 20-4 14 65-3 20 10 8. Your program should perform the following tasks: longer than 255 integers) displaying the results, I will only use inputs between 0 and 9999. 1. read the number of integers in the sequence (note: for this assignment, no sequence will be 2. read and store each integer in the sequence into its own location in an array. For the sake of 3. convert the data into the easy RLE format and store it in a second array 4. output the resulting encoded data. A sample input and output follows ubrey@aubrey-Lenovo-G780:-/Desktop/class/c/tests /erle Please enter the length of sequence: 25 Input: 10 20 25 40 40 46 40 60 100 100 100 23 23 23 23 utput: 10 20 25 ubrey@aubrey-Lenovo-G780:-/Desktop/class/c/tests -4 40 60 3 100 10 0 4 23

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions