Skip to content

Commit d7da7e7

Browse files
authored
fix up priorityqueue comments (#7350)
1 parent 1443692 commit d7da7e7

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

xml/System.Collections.Generic/PriorityQueue`2.xml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
<Docs>
2121
<typeparam name="TElement">Specifies the type of elements in the queue.</typeparam>
2222
<typeparam name="TPriority">Specifies the type of priority associated with enqueued elements.</typeparam>
23-
<summary>Represents a min priority queue.</summary>
23+
<summary>Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed.</summary>
2424
<remarks>
2525
<format type="text/markdown"><![CDATA[
2626
2727
## Remarks
2828
29-
Implements an array-backed quaternary min-heap. Each element is enqueued with an associated priority
30-
that determines the dequeue order: elements with the lowest priority get dequeued first.
29+
Implements an array-backed, quaternary min-heap. Each element is enqueued with an associated priority that determines the dequeue order. Elements with the lowest priority are dequeued first.
3130
3231
]]></format>
3332
</remarks>
@@ -102,8 +101,7 @@ Implements an array-backed quaternary min-heap. Each element is enqueued with an
102101
103102
## Remarks
104103
105-
Constructs the heap using a heapify operation,
106-
which is generally faster than enqueuing individual elements sequentially.
104+
Constructs the heap using a heapify operation, which is generally faster than enqueuing individual elements sequentially.
107105
108106
]]></format>
109107
</remarks>
@@ -165,8 +163,7 @@ Constructs the heap using a heapify operation,
165163
166164
## Remarks
167165
168-
Constructs the heap using a heapify operation,
169-
which is generally faster than enqueuing individual elements sequentially.
166+
Constructs the heap using a heapify operation, which is generally faster than enqueuing individual elements sequentially.
170167
171168
]]></format>
172169
</remarks>
@@ -236,7 +233,7 @@ Constructs the heap using a heapify operation,
236233
</ReturnValue>
237234
<Docs>
238235
<summary>Gets the priority comparer used by the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
239-
<value>To be added.</value>
236+
<value>The comparer that determines the priority of items in the queue.</value>
240237
<remarks>To be added.</remarks>
241238
</Docs>
242239
</Member>
@@ -257,7 +254,7 @@ Constructs the heap using a heapify operation,
257254
</ReturnValue>
258255
<Docs>
259256
<summary>Gets the number of elements contained in the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
260-
<value>To be added.</value>
257+
<value>The number of elements contained in the queue.</value>
261258
<remarks>To be added.</remarks>
262259
</Docs>
263260
</Member>
@@ -278,7 +275,7 @@ Constructs the heap using a heapify operation,
278275
</ReturnValue>
279276
<Parameters />
280277
<Docs>
281-
<summary>Removes and returns the minimal element from the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
278+
<summary>Removes and returns the minimal element from the <see cref="T:System.Collections.Generic.PriorityQueue`2" /> - that is, the element with the lowest priority value.</summary>
282279
<returns>The minimal element of the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</returns>
283280
<remarks>To be added.</remarks>
284281
<exception cref="T:System.InvalidOperationException">The queue is empty.</exception>
@@ -339,9 +336,7 @@ Constructs the heap using a heapify operation,
339336
340337
## Remarks
341338
342-
Implements an insert-then-extract heap operation that is generally more efficient
343-
than sequencing Enqueue and Dequeue operations: in the worst case scenario only one
344-
sift-down operation is required.
339+
Implements an insert-then-extract heap operation that's generally more efficient than sequencing enqueue and dequeue operations.
345340
346341
]]></format>
347342
</remarks>
@@ -374,7 +369,7 @@ Implements an insert-then-extract heap operation that is generally more efficien
374369
</Parameters>
375370
<Docs>
376371
<param name="items">The pairs of elements and priorities to add to the queue.</param>
377-
<summary>Enqueues a sequence of element/priority pairs to the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
372+
<summary>Enqueues a sequence of element-priority pairs to the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
378373
<remarks>To be added.</remarks>
379374
<exception cref="T:System.ArgumentNullException">The specified <paramref name="items" /> argument was <see langword="null" />.</exception>
380375
</Docs>
@@ -478,8 +473,7 @@ Implements an insert-then-extract heap operation that is generally more efficien
478473
479474
## Remarks
480475
481-
This method can be used to minimize a collection's memory overhead
482-
if no new elements will be added to the collection.
476+
This method can be used to minimize a collection's memory overhead if no new elements will be added to the collection.
483477
484478
]]></format>
485479
</remarks>
@@ -519,9 +513,9 @@ This method can be used to minimize a collection's memory overhead
519513
</Parameter>
520514
</Parameters>
521515
<Docs>
522-
<param name="element">The removed element.</param>
523-
<param name="priority">The priority associated with the removed element.</param>
524-
<summary>Removes the minimal element from the <see cref="T:System.Collections.Generic.PriorityQueue`2" />, and copies it to the <paramref name="element" /> parameter, and its associated priority to the <paramref name="priority" /> parameter.</summary>
516+
<param name="element">When this method returns, contains the removed element.</param>
517+
<param name="priority">When this method returns, contains the priority associated with the removed element.</param>
518+
<summary>Removes the minimal element from the <see cref="T:System.Collections.Generic.PriorityQueue`2" />, and copies it and its associated priority to the <paramref name="element" /> and <paramref name="priority" /> arguments.</summary>
525519
<returns>
526520
<see langword="true" /> if the element is successfully removed; <see langword="false" /> if the <see cref="T:System.Collections.Generic.PriorityQueue`2" /> is empty.</returns>
527521
<remarks>To be added.</remarks>
@@ -561,10 +555,9 @@ This method can be used to minimize a collection's memory overhead
561555
</Parameter>
562556
</Parameters>
563557
<Docs>
564-
<param name="element">The minimal element in the queue.</param>
565-
<param name="priority">The priority associated with the minimal element.</param>
566-
<summary>Returns a value that indicates whether there is a minimal element in the <see cref="T:System.Collections.Generic.PriorityQueue`2" />, and if one is present, copies it to the <paramref name="element" /> parameter, and its associated priority to the <paramref name="priority" /> parameter.
567-
The element is not removed from the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
558+
<param name="element">When this method returns, contains the minimal element in the queue.</param>
559+
<param name="priority">When this method returns, contains the priority associated with the minimal element.</param>
560+
<summary>Returns a value that indicates whether there is a minimal element in the <see cref="T:System.Collections.Generic.PriorityQueue`2" />, and if one is present, copies it and its associated priority to the <paramref name="element" /> and <paramref name="priority" /> arguments. The element is not removed from the <see cref="T:System.Collections.Generic.PriorityQueue`2" />.</summary>
568561
<returns>
569562
<see langword="true" /> if there is a minimal element; <see langword="false" /> if the <see cref="T:System.Collections.Generic.PriorityQueue`2" /> is empty.</returns>
570563
<remarks>To be added.</remarks>
@@ -593,8 +586,7 @@ This method can be used to minimize a collection's memory overhead
593586
594587
## Remarks
595588
596-
The enumeration does not order items by priority, since that would require N * log(N) time and N space.
597-
Items are instead enumerated following the internal array heap layout.
589+
The enumeration does not order items by priority, since that would require N * log(N) time and N space. Instead, items are enumerated following the internal array heap layout.
598590
599591
]]></format>
600592
</remarks>

0 commit comments

Comments
 (0)