Question: Create a C program that tests whether two sequences of positive numbers are order equivalent. Two sequences a and b are order equivalent if they

Create a C program that tests whether two sequences of positive numbers are order equivalent.

Two sequences a and b are order equivalent if they have the same number of elements and

they both contain less than two numbers or

if for all i,j,1 i, j n where n is the length of a sequence

a[i] a[j] if only if b[i] b[j]

0r

Examples of order equivalent sequences:

7 5 9 13 12

4 2 25 33 26

12 and 8

The program must accept the two sequences with no separator between the two. If the number of numbers accepted is n, the first n/2 numbers are assumed to be in the first sequence and the rest form the second sequence. The program must then check the sequences for order equivalence and print the result. You can assume that the maximum size of the two sequences is 100. You need to use 0 or any negative number to mark the end of the sequence.

Please remember to organize the code as below:

Have two functions besides main:

one that accepts the two sequences and

the other that checks for order equivalence and returns an integer depending on the test

The main function prints the message for the user.

You cannot use any global variables.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!