Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be Python. All i need help with is writing Are the functions. For this HW , students will complete the first 6 methods on

Must be Python. All i need help with is writing Are the functions.
For this HW, students will complete the first 6 methods on page 3 of the HW3&4 document.
to_hex_string
count_runs
encode_rle
get_decoded_length
decode_rle
string_to_data
They must match specifications and pass the given test cases, which will be your means of submission for this part of the assignment.
To guarantee functionality moving forward to HW4, you are expected to receive full marks for this section.
Note: In this HW3B, you don't need to implement the functionality of the main method. We will use unit testing to test each of these six functions. Please write your unit tests before your submission.
Class Methods
Student classes are required to provide all of the following methods with defined behaviors. We recommend completing them in the following order:
to_hex_string (data)
Translates data (RLE or raw) a hexadecimal string (without delimiters). This method can also aid debugging. Ex: to_hex_string ([3,15,6,4]) yields string "3f64".
count_runs(flat_data)
Retums number of runs of data in an image data set; double this result for length of encoded (RLE) list.
Ex: count_runs ([15,15,15,4,4,4,4,4,4]) yields integer 2.
encode_rle(flat_data)
Returns encoding (in RLE) of the raw data passed in; used to generate RLE representation of a data.
Ex: encode_rle ([15,15,15,4,4,4,4,4,4]) yields list 3,15,6,4.
get_decoded_length(rle_data)
Returns decompressed size RLE data; used to generate flat data from RLE encoding. (Counterpart to #2)
Ex: get_decoded_length ([3,15,6,4]) yields integer 9.
decode_rle(rle_data)
Returns the decoded data set from RLE encoded data. This decompresses RLE data for use. (Inverse of #3)
Ex: decode_rle ([3,15,6,4]) yields list 15,15,15,4,4,4,4,4,4,4.
string_to_data(data_string)
Translates a string in hexadecimal format into byte data (can be raw or RLE).(Inverse of #1)
Ex: string_to_data ("3f64") yields list 3,15,6,4.
to_rle_string(rle_data)
Translates RLE data into a human-readable representation. For each run, in order, it should display the run length in decimal (1-2 digits); the run value in hexadecimal (1 digit); and a delimiter, :, between runs. (See examples in standalone section.)
Ex: to_rle_string ([15,15,6,4]) yields string "15f:64".
string_to_rle(rle_string)
Translates a string in human-readable RLE format (with delimiters) into RLE byte data. (Inverse of #7)
Ex: string_to_rle("15f:64") yields list [15,15,6,4].
image text in transcribed

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago