Q6Multiple correct6 Marks13 Apr 2025
Consider the procedure findSomething, that accepts a non-empty list of integers L as input. Choose the correct option(s).
```
Procedure findSomething(L)
if(length(L) == 1){
return(first(L))
}
else{
if(first(L) > last(L)){
return(findSomething(rest(L)))
}
else{
return(findSomething(init(L)))
}
}
End findSomething
```
―――――――――――――――――――――――――――――――――――――――――――――――――――――――
--- End of Question Paper ---
INDIAN INSTITUTE OF TECHNOLOGY MADRAS
IMPORTANT INSTRUCTIONS — READ CAREFULLY BEFORE ATTEMPTING
• MCQ — Single correct answer only. Selecting more than one answer will be treated as wrong.
• MSQ — One or more answers may be correct. Partial marking may apply.
• SA — Numerical or short text answer. Enter the exact value. Do not write any unit or description.
• Comprehension — Read the passage or pseudocode scenario carefully before attempting sub-parts.
• For code-based questions — read every line carefully; differences between options may be a single operator, variable name, or indentation structure.
• Indentation matters very much — nested blocks are indented consistently.
• Equations and mathematical notations are written in proper LaTeX format.