in Education by
Consider yourself to be in a planet where the computational power of chips to be slow. You have an array of size 10.You want to perform enqueue some element into this array. But you can perform only push and pop operations .Push and pop operation both take 1 sec respectively. The total time required to perform enQueue operation is? (a) 20 (b) 40 (c) 42 (d) 43 Answer with explanation needed. Select the correct answer from above options Data Structures and Algorithms questions and answers

1 Answer

0 votes
by
 
Best answer
Correct answer is (d) 43 Easy explanation - First you have to empty all the elements of the current stack into the temporary stack, push the required element and empty the elements of the temporary stack into the original stack. Therfore taking 10+10+1+11+11= 43 seconds.

Related questions

0 votes
    What is the number of words that can be formed from the given Directed Acyclic Word Graph? (a) 2 ... answer from above options Data Structures and Algorithms questions and answers...
asked Nov 14, 2021 in Education by JackTerrance
0 votes
    The actual pairing heap implementation uses the right child and left child representation. (a) true (b) ... from above options Data Structures and Algorithms questions and answers...
asked Nov 14, 2021 in Education by JackTerrance
0 votes
    I have 100 records in source table, but I want to load 1, 5,10,15,20…..100 into target table. How can I do this? Explain in detailed mapping flow....
asked Mar 28, 2021 in Technology by JackTerrance
0 votes
    I have three same source structure tables. But, I want to load into single target table. How do I do this? Explain in detail through mapping flow....
asked Mar 28, 2021 by JackTerrance
...