Java Reference
In-Depth Information
recursive function
FloodFillingQueue
by using a queue. Which imple-
mentation technique is the most
memory
e
cient?
Exercise 8.3 (Sorting using a priority queues)
Consider sorting a set of strings stored initially in an array
String []
array
using a priority queue defined with respect to the lexicographic
order on strings. Implement the priority queue for
String
elements.
Then sort the initial array of strings by first inserting all strings into
the priority queue, and then successively retrieving them. What is the
time and memory complexity of sorting using priority queues?
Search WWH ::
Custom Search