What is an entry in terms of priority queue? Name the two methods associated with the entries.
An entry is a key-value pair that allows for efficient insertion and removal based on keys.
key() : returns a key for this entry
value(): returns a value for this entry
What is an entry in terms of priority queue? Name the two methods associated with the entries.
An entry is a key-value pair that allows for efficient insertion and removal based on keys.
key() : returns a key for this entry
value(): returns a value for this entry
Describe what total order relations are within the context of PQs
Criteria that a key must meet/comply with in order to be comparable
Name and give a formula for the 3 different total order relations
Name 3 applications of PQs to the real world
What does the comparator ADT do?
It encapsulates the comparison of two objects according to a given total order relation
Describe how the comparator main method compare(x,y) works
it works by returning an integer based on how 2 objects relate to one another. it will return i>0 if x > y, it will return i = 0 if x =y, it will return i < 0 if x < y otherwise give an error if x and y cannot be compared.
What two main methods are associated with PQs?
insert(k,v) and removeMin()
What two main methods are associated with PQs?
insert(k,v) and removeMin()
Discuss the difference in the performance of the two main methods of PQ when implemented with an unsorted list vs a sorted list
Usorted List:
Discuss the difference in the performance of the two main methods of PQ when implemented with a sorted list
Name and give a brief explanation of the 2 variations of PQ sort. Also, state the runtime of their different phases and the overall runtime
What is in-place insertion-sort and how does it work?
It is a way of sorting a PQ without the use of an external data structure like a LL in the case of selection and insertion sort.
It works by keeping a portion of the queue sorted and swapping out of order elements