Question: This program should be in C language: Given a linked list, check whether it is an arithmetic progression, geometric progression, or neither Define a function

This program should be in C language:

This program should be in C language: Given a linked list, check

Given a linked list, check whether it is an arithmetic progression, geometric progression, or neither Define a function int checkSeries (node head), which takes a linked list as input and checks whether the linked list is an arithmetic progression or geometric progression or neither You will be given N series of integers, each which you have to store in a separate linked list. For each linked list, call the function checkSeries Input Format Take input from a file in3.txt. The first line contains a single integer N, denoting the number of test cases. The first line of each test case contains a single integer L, denoting the length of the series. The second line of each test case contains L integers. Constraints Output Format For each series, print 1 if it is an arithmetic progression, 2 if it is a geometric progression, and 0 if it is neither Sample Input 2 4 6 8 10 10 100 1000 11 12 13 16 Sample Output Explanation There are 3 test cases. The first series contains 5 elements, and is an arithmetic progression. The second series contains 3 elements, and is a geometric progression. The third series contains 4 elements, and is neither

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!