We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Data Structures MCQ 3
Data Structures MCQ 3
Sort by
recency
|
42 Discussions
|
Please Login in order to post a comment
Answer is Stack because when we insert new element in stack and want to delete that element then it follow last in first out ordering
Answer is Stack because when we insert new element in stack and want to delete that element then it follow last in first out ordering
please explain 2nd question
Think of it like stacking plates. When you add a plate, it goes on top. So, the plate you added last is the first one you take off.
In the code, it's similar. The function puts new elements at the beginning of a list, like stacking plates. The most recent element you put in is the first one you can get out. It's like a rule – last in, first out. Just like how you take off the top plate to reach the ones below, you get the latest added element first when using this function.
Stack
explain 2nd number question
Think of it like stacking plates. When you add a plate, it goes on top. So, the plate you added last is the first one you take off.
In the code, it's similar. The function puts new elements at the beginning of a list, like stacking plates. The most recent element you put in is the first one you can get out. It's like a rule – last in, first out. Just like how you take off the top plate to reach the ones below, you get the latest added element first when using this function.