Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1ByAPJ3
via LifeLong Community
Priority queue - Rosetta Code
Scala has a class PriorityQueue in its standard library.
(Link->http://ift.tt/1ByAQwA) scala.collection.mutable.PriorityQueue
(Link->http://ift.tt/1ByAQwA) Ordered[Task] {
(Link->http://ift.tt/1ByAQwA) .prio
}
//test
(Link->http://ift.tt/1ByAQwA) q=PriorityQueue[Task]() ++ Seq(Task(3, "Clear drains"), Task(4, "Feed cat"),
Task(5, "Make tea"), Task(1, "Solve RC tasks"), Task(2, "Tax return"))
(Link->http://ift.tt/1ByAQwA) (q.nonEmpty) println(q dequeue)
http://ift.tt/1AfseXR
Done
Scala has a class PriorityQueue in its standard library.
(Link->http://ift.tt/1ByAQwA) scala.collection.mutable.PriorityQueue
(Link->http://ift.tt/1ByAQwA) Ordered[Task] {
(Link->http://ift.tt/1ByAQwA) .prio
}
//test
(Link->http://ift.tt/1ByAQwA) q=PriorityQueue[Task]() ++ Seq(Task(3, "Clear drains"), Task(4, "Feed cat"),
Task(5, "Make tea"), Task(1, "Solve RC tasks"), Task(2, "Tax return"))
(Link->http://ift.tt/1ByAQwA) (q.nonEmpty) println(q dequeue)
http://ift.tt/1AfseXR
Done
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1ByAPJ3
via LifeLong Community
No comments:
Post a Comment