Prasnya
Prasnya
Prasnya
Continue with Google
Question 44 - Week 5 Practice | Prasnya
Q44
00:00
2 Apr 2023
Q44.
Consider the following procedure, where `L1` and `L2` are two non-empty lists. `findSomething(L1, L2)` will return `True` when: ``` Procedure findSomething(L1, L2) if(length(L1) != length(L2)) { return(False) } while(length(L1) > 0) { if(first(L1) != last(L2)) { return(False) } L1 = rest(L1) L2 = init(L2) } return(True) End findSomething ```
A
all the elements of both lists `L1` and `L2` are same but arranged in the reverse order.
B
both lists `L1` and `L2` are same.
C
all the elements of list `L1` are present in `L2` where `length(L2) > length(L1)`.
D
all the elements of list `L2` are present in `L1` where `length(L1) > length(L2)`.
Save
Check
Details
Q44
00:00
2 Apr 2023
Q44.
Consider the following procedure, where `L1` and `L2` are two non-empty lists. `findSomething(L1, L2)` will return `True` when: ``` Procedure findSomething(L1, L2) if(length(L1) != length(L2)) { return(False) } while(length(L1) > 0) { if(first(L1) != last(L2)) { return(False) } L1 = rest(L1) L2 = init(L2) } return(True) End findSomething ```
A
all the elements of both lists `L1` and `L2` are same but arranged in the reverse order.
B
both lists `L1` and `L2` are same.
C
all the elements of list `L1` are present in `L2` where `length(L2) > length(L1)`.
D
all the elements of list `L2` are present in `L1` where `length(L1) > length(L2)`.
Save
Check
Details