Help explain the answer to this question Assume alist is a list of integer eleme
ID: 3723064 • Letter: H
Question
Help explain the answer to this question
Explanation / Answer
In the Loop 1:
The right most element of aList is in the bottom of stk and the first element of aList is at the top of stk.
In Loop 2:
Here, the top most elements of the stack if pushed at the front of the list.
So, the bottom most element in stk will be the first element of aList.
So, the order of the list is now reversed.
Answer : (b)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.