샘플
show how omitting the queue comparator changes element priority semantics
sha256:4c5ea45d1953eb6c9bee6f0124f6cac8618d0a6fde9ad4c2d477cdea982b3a36
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- show how omitting the queue comparator changes element priority semantics HOW
- 패키지
- collection 1.19.1
- 환경
- dart
- 생성일
- 2026-08-17T02:04:34Z
흔히 이렇게 알고 있다
A priority queue should return the largest value first when no comparator is supplied.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- A `PriorityQueue` without a comparator argument is a min-heap, so `removeFirst()` returns 1 before 3 from [3, 1, 5].
- Removing from a default `PriorityQueue<int>` created with [3, 1, 5] yields 1 first, then 3, then 5.
- Providing `(a, b) => b.compareTo(a)` to `PriorityQueue` flips default priority and returns 5 before 1 for the same values.
파일
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-16 · ed25519:d91480838ac982c9