user image

Preeti Tripathi

Job Interview Skills
English
2 years ago

Question 81. You Have Got 1 Million Parking Slots. At A Time A Parking Slot Can Be Free Or Not. To Get Next Slot Easily Which Data Structure To Implement?

user image

Abhishek Mishra

2 years ago

Use Stack. If you use Stack, we can just get the next slot by using stack.Pop() If you use List, we have to iterate through all list and check the status and retrieve. So stack would be advantageous.

Recent Doubts

Close [x]