--- a/PriorityQueue.st Fri Oct 14 00:43:27 2016 +0200
+++ b/PriorityQueue.st Fri Oct 14 00:46:02 2016 +0200
@@ -16,21 +16,24 @@
a priority queue is a collection with a given maximum size
which only keeps the maxSize largest values.
Only up to maxSize elements are stored at any time.
- The internal organization is a heap; eg. elements are not kept
- sorted internally.
+ The internal organization is a heap;
+ eg. elements are not kept sorted internally.
- When elements are added, a check is made, if the new element should
- be kept or not.
+ When elements are added, a check is made,
+ if the new element should be kept or not.
Finally, when all elements have been added,
get the elements in sorted order by repeated calls to removeFirst,
which will remove and return the smallest element.
+
+ [author:]
+ Claus Gittinger
"
!
examples
"
- find the 10 largest files in the stx source tree
+ find the 10 largest files in the stx source tree
[exBegin]
|pq dir|
@@ -51,7 +54,7 @@
].
[exEnd]
- generate 1 million random numbers and show the 10 largest
+ generate 1 million random numbers and show the 10 largest
[exBegin]
|pq|
@@ -64,7 +67,7 @@
].
[exEnd]
- a little test
+ a little test
[exBegin]
|pq|