You have two jars, one jar which has 10 rings and the other has none. They are placed one above the other. You want to remove the last ring in the jar. And the second jar is weak and cannot be used to store rings for a long time.

You have two jars, one jar which has 10 rings and the other has none. They are placed one above the other. You want to remove the last ring in the jar. And the second jar is weak and cannot be used to store rings for a long time. Correct Answer Empty the first jar by removing it one by one from the first jar and placing it into the second jar and empty the second jar by placing all the rings into the first jar one by one

This is similar to performing dequeue operation using push and pop only. Elements in the first jar are taken out and placed in the second jar. After removing the last element from the first jar, remove all the elements in the second jar and place them in the first jar.
Bissoy MCQ

Related Questions

You want to improve the TCP transmission speed of a Windows 2000 Server computer. You also want to remove an unused registry key. You use Regedit32 to edit the registry of the Windows 2000 Server. You insert a value in the registry named TCPWindowSize, and you remove the unused key. You restart the computer, but the computer stops responding before the logon screen appears. You want to return the computer to its previous configuration. What should you do?