πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      Which data structure supports extraction of both min and

      max in O(1) time and insertion in O(log n)?
      A Binary heap Correct Answer Incorrect Answer
      B Min-Max heap Correct Answer Incorrect Answer
      C Stack Correct Answer Incorrect Answer
      D AVL tree Correct Answer Incorrect Answer
      E Priority queue with array Correct Answer Incorrect Answer

      Solution

      Min-Max heap maintains min and max in alternate levels, allowing O(1) access and O(log n) insertion/deletion.

      Practice Next
      More Algorithms Questions
      ask-question