Q-5: This list of integers is stored as a stack S1 with 105 being pushed in first. A = (5, 5, 3, 10, -15, 45, 71, 105).
Posted: Sun Jul 03, 2022 11:24 am
Q-5: This list of integers is stored as a stack S1 with 105 being pushed in first. A = (5, 5, 3, 10, -15, 45, 71, 105). Stack S2 is a new empty stack. Show the result of the following loop. What is the worst case O(*) runtime? int index = 0; index = pop(S1); if(( index= =0) || (index= 1)) { return; } while(!stack is empty(S1)) { if( peek(S1)%index = 0) { push(S2, pop(S1)); push(S1, peek(S2)/index); } else { pop(S1);