Chapter 6 - Priority Queues (Heaps)

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which operation is not supported in constant time by a double-ended queue (deque)?

Access and deletion of the minimum item

Which operation is not effciently supported by priority queues?

Find

Which of the four operations below can be used to implement the other three for the skew heap?

Merge

n elements are inserted one by one into an initially empty binary heap. The total running time is

O ( n log n ) worst case and O ( n ) average case

The running time of BuildHeap is

O(n) worst case and O(n) average case

If an element in a binary heap is stored in position i and the root is at position 1, then where is the parent stored?

[i/2] (lower bounded)

Which of the following data structures uses a sentinel?

binary heap

Percolate up and down are used for

binary heaps

Which of the following could be used as an ecient priority queue?

binary search tree

Which of the following is not a binary tree?

binomial queue

Which of the following is true about the skew heap?

each node stores nothing besides an item and two pointers

Which data structure is generally used to implement a symbol table?

hash table

Every node in a (min) binary heap

is no larger than its children

A node with key 8 has a left child with key 10. Which of the following objects could this node be found in?

min heap

Which data structure maintains the event set in an event-driven (discrete-event) simulation?

priority queue

Which of the following does the binary heap implement?

priority queue

6, 8, 4, 3, and 1 are inserted into a data structure in that order. An item is deleted using only a basic data structure operation. If the deleted item is a 1, the data structure cannot be a

queue

Jobs sent to a printer are generally placed on a

queue

Which data structure is used by the compiler to implement recursion?

stack

Which data structure is used to check for balanced parentheses?

stack


Ensembles d'études connexes

Derm, CV, Neuro NCLEX Practice Questions

View Set

1 Chemistry Chapter 13 Test Review

View Set

06 - الخزينة العمومية

View Set