Sort by

recency

|

42 Discussions

|

  • + 0 comments

    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

  • + 0 comments

    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

  • + 1 comment

    please explain 2nd question

    • + 0 comments

      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.

  • + 0 comments
    Stack
    
  • + 1 comment

    explain 2nd number question

    • + 0 comments

      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.