[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Double-sided priority Queues using min-max heaps

Posted on 1999-12-07
5
Medium Priority
?
928 Views
Last Modified: 2008-02-01

How are the basic operations on a min-max heap implemented? They are insert(), deletemin(), deletemax(), findmin(), and findmax().
0
Comment
Question by:ksdg025
  • 2
  • 2
5 Comments
 

Author Comment

by:ksdg025
ID: 2262524

A queue must be defined as:

PriorityQueue {
     int Size;
     int Maxsize;
     int *Elements;
}

Where Size is the current size of the heap, MaxSize is its's capacity, *Elements is a pointer to an array that con hold Maxsize integers.


0
 
LVL 1

Expert Comment

by:Aggarwal
ID: 2263085
these are pretty staright forward . what do u want actually ???do u want implementation ???
0
 
LVL 2

Accepted Solution

by:
_lychee_ earned 600 total points
ID: 2264367
a min-max heap is one where the alternate levels are max and min of all their descendants... here's a url that explains (somewhat) the percolate procedures... if u find it confusing, pls post and i'll elab... u need percolation to use a heap and then insertion, deletion and extraction of min/max become v. easy:

http://www.diku.dk/users/jyrki/Performance_Engineering/heap_report/node11.html
0
 

Author Comment

by:ksdg025
ID: 2267101
The web page did provide somewhat of a general overview of the subject and it's implementation and it was enough to get me started. Thanks!
0
 
LVL 2

Expert Comment

by:_lychee_
ID: 2267168
u're most welcome :)
0

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question