From 7ec4eedfe14d441bdf41dce04f271ec9264314b7 Mon Sep 17 00:00:00 2001 From: Jaime <42359730+bracteatus@users.noreply.github.com> Date: Fri, 26 Jul 2019 19:04:21 -0600 Subject: Create ch-2.pl --- challenge-018/jaime/perl5/ch-2.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 challenge-018/jaime/perl5/ch-2.pl diff --git a/challenge-018/jaime/perl5/ch-2.pl b/challenge-018/jaime/perl5/ch-2.pl new file mode 100644 index 0000000000..6689a671fb --- /dev/null +++ b/challenge-018/jaime/perl5/ch-2.pl @@ -0,0 +1,17 @@ +# +# # Challenge #2 +# +# Write a script to implement Priority Queue. It is like regular queue +# except each element has a priority associated with it. In a priority +# queue, an element with high priority is served before an element with +# low priority. Please check this wiki page for more informations. It +# should serve the following operations: +# +# 1. is_empty: check whether the queue has no elements. +# +# 2. insert_with_priority: add an element to the queue with an +# associated priority. +# +# 3. pull_highest_priority_element: remove the element from the queue +# that has the highest priority, and return it. If two elements have the +# same priority, then return element added first. -- cgit