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 where n is the length of a sequence
Examples of order equivalent sequences:
7 5 9 13 12 and 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
Get step-by-step solutions from verified subject matter experts
