You want a function which takes two arrays a and b which are both of the same length n and determines if they are "reversals" of each other: return 1 if a is the reverse of b (and vice-versa) return 0 otherwise.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question

Please code in C.

You want a function which takes two arrays a and b which are both of the same length n and determines if they are "reversals" of each other:
return 1 if a is the reverse of b (and vice-versa)
return 0 otherwise.
examples:
{1, 3, 3, 4) is the reverse of {4, 3, 3, 1}
{9, 8, 2, 2, 1, 9} is the reverse of {9, 1, 2, 2, 8, 9}
Your job: write the function! Skeleton given below:
int rev_eq(int a[], int b[], int n) {
}
Font Sizes
Transcribed Image Text:You want a function which takes two arrays a and b which are both of the same length n and determines if they are "reversals" of each other: return 1 if a is the reverse of b (and vice-versa) return 0 otherwise. examples: {1, 3, 3, 4) is the reverse of {4, 3, 3, 1} {9, 8, 2, 2, 1, 9} is the reverse of {9, 1, 2, 2, 8, 9} Your job: write the function! Skeleton given below: int rev_eq(int a[], int b[], int n) { } Font Sizes
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning