Assg3 - CSC1520 Computer Principles and C Programming 2009 Fall Department of Computer Science and Engineering The Chinese University of Hong Kong

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Department of Computer Science and Engineering, The Chinese University of Hong Kong Assignment 3: Run-Length Encoding Due: 23:59:59, 27 Oct 2009 (Tue) Full marks: 100 Introduction Run-length encoding (RLE) is a very simple form of data compression in which runs of data are stored as a single data value and its count. For example, consider the sequence of text: “WWWWWWWWWWWWBBBBWWWWWWWWWWWWWWWWWWWWW WWWABBBBBB” Applying RLE to the text will compress it to become: “12W4B24W1A6B” which is interpreted as twelve W’s, four B’s, twenty-four W’s, one A, and six B’s. The original text contains 47 characters while the compressed version contains only 12 characters. In this assignment, you will write a program which can perform data compression and decompression using RLE. Program Specification The program will repeatedly display the following main menu, prompting the program user to choose what operation to be performed. 1. Compress 2. Decompress 3. Exit Enter your choice (1-3): You can assume that the program user will only enter the values 1, 2, or 3 in the main menu. The operation to be performed for each menu item is described below. 1.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/26/2009 for the course FINANCE FIN4110 taught by Professor Zhanghua during the Spring '09 term at CUHK.

Page1 / 4

Assg3 - CSC1520 Computer Principles and C Programming 2009 Fall Department of Computer Science and Engineering The Chinese University of Hong Kong

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online