Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ac of the following question At the ead, lath for False, for each of the fallowi

ID: 3696306 • Letter: A

Question

ac of the following question At the ead, lath for False, for each of the fallowin Hir Tee or Fix Faln, fiw each of T 0) Aue aray1 and aray2 are the a To anigs the contents of array? to array1, you n aay2 are the names of arays, and u array1, you would use the followiis erpayiaraya variables in C c+ performs concatenation The eperatoron r O)A T r (4) When we insert a data item into in Ct+ perform r D ) The"st operator on bool variables in Ctt performs All elements of an array are of the same data t ype a data item into an array, we always need to check i to check if u if the the array is o es are initialized to zero by default. () Inager variables are initial Choice descrintions into machine code?

Explanation / Answer

1) You cannot assign arrays like this. You can assign like this if they are pointers to the arrays.

2) Concatenation is not possible on bool.

3) All elemnts should be of same datatype in an array.

4) There is no need that it is 0. It can be anything.

5) By default int variables are initialised with 0.

Answers:
1) F
2) F
3) T
4) F
5) T

Code:

int run_length(int num[],int size){
   int max_length=0;
   int count =1;
   for(int i=1;i<size;i++){
       if(num[i]==num[i-1]){
           count++;
       }
       else{
           if(max_length<count){
               max_length=count;
               count=0;
           }
       }
   }
   return max_length;
}