Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8008239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:04:31+00:00 2026-06-04T18:04:31+00:00

Priority queue: Basic operations: Insertion Delete (Delete minumum element) Goal: To provide efficient running

  • 0

Priority queue:
Basic operations: Insertion
Delete (Delete minumum element)

Goal: To provide efficient running time or order of growth for above functionality.

Implementation of Priority queue By:

Linked List: Insertion will take o(n) in case of insertion at end o(1) in case of 
             insertion at head.
             Delet (Finding minumum and Delete this ) will take o(n) 

BST:
   Insertion/Deltion of minimum = In avg case it will take o(logn) worst case 0(n)

AVL Tree: 
   Insertion/deletion/searching: o(log n) in all cases.

My confusion goes here:

Why not we have used AVL Tree for implementation of Priority queue, Why we gone
for Binary heap…While as we know that in AVL Tree we can do insertion/ Deletion/searching in o(log n) in worst case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:04:32+00:00Added an answer on June 4, 2026 at 6:04 pm

    Complexity isn’t everything, there are other considerations for actual performance.

    For most purposes, most people don’t even use an AVL tree as a balanced tree (Red-Black trees are more common as far as I’ve seen), let alone as a priority queue.

    This is not to say that AVL trees are useless, I quite like them. But they do have a relatively expensive insert. What AVL trees are good for (beating even Red-Black trees) is doing lots and lots of lookups without modification. This is not what you need for a priority queue.

    As a separate consideration — never mind your O(log n) insert for a binary heap, a fibonacci heap has O(1) insert and O(log N) delete-minimum. There are a lot of data structures to choose from with slightly different trade-offs, so you wouldn’t expect to see everyone just pick the first thing that satisfies your (quite brief) criteria.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose that I have a priority queue which removes elements in increasing order, and
Im working on a method for insertion into priority queue using the huffman method.
I am trying to implement an efficient priority queue in Java. I got to
I am interested in implementing a priority queue to enable an efficient Astar implementation
Java's priority queue is a data structure with O(log n) complexity for put (insertion)
The default stl priority queue is a Max one (Top function returns the largest
If yes then why priority queue is a non-linear data structure? Does non-linear data
I need a priority queue where I can increase or decrease the priority key.
Does the Priority Queue data structure follow the set theory in terms of the
I need some kind of priority queue to store pairs <key, value> . Values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.