aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-018/jaime/perl5/ch-2.pl17
1 files changed, 17 insertions, 0 deletions
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.