Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please fill in ToDo sections in an Inversion Counter Test Cases Text Version: # TODO - Make sure your code can handle these cases. run_test_args

Please fill in ToDo sections in an Inversion Counter Test Cases

image text in transcribed

image text in transcribed

Text Version:

# TODO - Make sure your code can handle these cases. run_test_args "" "x 1 2 3" "Enter sequence of integers, each followed by a space: Error: Non-integer value 'x' received at index 0." run_test_args "" "1 2 x 3" "Enter sequence of integers, each followed by a space: Error: Non-integer value 'x' received at index 2." run_test_args "lots of args" "" "Usage: ./inversioncounter [slow]" run_test_args "average" "" "Error: Unrecognized option 'average'." run_test_args "" "" "Enter sequence of integers, each followed by a space: Error: Sequence of integers not received." run_test_args "" " " "Enter sequence of integers, each followed by a space: Error: Sequence of integers not received."

# TODO - write some tests that use the 'slow' approach. Here is one example. # You are allowed up to 8 seconds to count inversions on up to 100,000 values. run_test_args "slow" "2 1" "Enter sequence of integers, each followed by a space: Number of inversions: 1"

# END slow tests

MAXTIME="1.250"

# TODO - write some tests that use the 'fast' approach. Here is one example. # You are allowed up to 1.25 seconds to count inversions on up to 100,000 values. run_test_args "" "2 1" "Enter sequence of integers, each followed by a space: Number of inversions: 1"

# END fast tests

Look for TODO in this template. Fill in each section [slow and fast] with test cases to ensure your algorithms are working correctly. Be sure to cover corner cases, such as having only one value having no inversions having the worst case number of inversions and anything else you can think of You may repeat the same test for 'slow' and fast, so write your cases carefully and thoroughly. You must write 10 solid test cases for each section. If you have somehow installed cygwin 32-bit, which I think no one did, LONG MAX will cap out at INT MAX, which is 2.1 billion. Some of my test cases go higher than that, so make sure you try things out in Linux Lab Look for TODO in this template. Fill in each section [slow and fast] with test cases to ensure your algorithms are working correctly. Be sure to cover corner cases, such as having only one value having no inversions having the worst case number of inversions and anything else you can think of You may repeat the same test for 'slow' and fast, so write your cases carefully and thoroughly. You must write 10 solid test cases for each section. If you have somehow installed cygwin 32-bit, which I think no one did, LONG MAX will cap out at INT MAX, which is 2.1 billion. Some of my test cases go higher than that, so make sure you try things out in Linux Lab

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

6. The cost of the training creates a need to show that it works.

Answered: 1 week ago