aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime <42359730+bracteatus@users.noreply.github.com>2019-07-26 19:04:21 -0600
committerJaime <42359730+bracteatus@users.noreply.github.com>2019-07-26 19:04:21 -0600
commit7ec4eedfe14d441bdf41dce04f271ec9264314b7 (patch)
tree25b88c89170d6798aea75dde326d5dfba3bf5664
parent8730a72d03faaed9e6c4f419e9b06805fb3171f2 (diff)
downloadperlweeklychallenge-club-7ec4eedfe14d441bdf41dce04f271ec9264314b7.tar.gz
perlweeklychallenge-club-7ec4eedfe14d441bdf41dce04f271ec9264314b7.tar.bz2
perlweeklychallenge-club-7ec4eedfe14d441bdf41dce04f271ec9264314b7.zip
Create ch-2.pl
-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.