LinkedIn Python Skill Assessment Quiz Answers

What is the runtime complexity of adding an item to a stack and removing an item from a stack?

Latest Update on 25th January, 2022 by Certification Course Answers

What is the runtime complexity of adding an item to a stack and removing an item from a stack?

  1.  Add items to a stack in O(1) time and remove items from a stack on O(n) time.
  2.  Add items to a stack in O(1) time and remove items from a stack in O(1) time.
  3.  Add items to a stack in O(n) time and remove items from a stack on O(1) time.
  4.  Add items to a stack in O(n) time and remove items from a stack on O(n) time.

Correct Answer:

  •  Add items to a stack in O(1) time and remove items from a stack in O(1) time.

Latest Updates

No posts found in this category.