Commit Graph
25 Commits
Author SHA1 Message Date
Karoy LorenteyandClaude Sonnet 4.6 67afae1edd [HeapModule] Heap.insert(contentsOf:): Use wrapping multiply in Floyd heuristic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 15:14:00 -07:00
Karoy Lorentey 1c69635852 Add SPDX-License-Identifier tags 2026-03-05 19:39:24 -08:00
Karoy Lorentey d9b09ecde8 Update copyright dates 2026-03-05 19:39:20 -08:00
AZero13 7f8a32c5a9 Change useFloyd heuristic to match comment
Comment says exceed, but this checks if it is less than the limit.
2025-12-06 12:58:07 -05:00
Karoy Lorentey dbc2866bb5 [Heap] removeAll(where:): Fix exception safety 2025-05-15 21:39:55 -07:00
Dakshin Devanand c7c38028cd Add Heap.removeAll(where:) 2025-05-15 21:39:50 -07:00
Karoy Lorentey 225159599d [Heap] Fix remaining tie break inconsistency in popMax 2025-05-15 17:34:16 -07:00
Karoy Lorentey 540348f147 [Heap] Update copyright notices 2024-02-02 16:20:21 -08:00
Karoy Lorentey 37e66d0e49 [Heap] Modernize generic declaration syntax 2024-02-02 16:20:21 -08:00
Karoy Lorentey 50f6307501 [Heap] Also add an init(minimumCapacity:) initializer 2024-01-29 17:57:14 -08:00
Karoy Lorentey 9022cbd153 [Heap] Add reserveCapacity 2024-01-29 17:51:00 -08:00
Karoy Lorentey a52457d6fc [Heap] Mark removeMin/removeMax @discardableResult 2024-01-29 17:50:44 -08:00
Karoy Lorentey 53831b3a22 [Heap] Update docs 2023-11-14 19:10:35 -08:00
Karoy Lorentey e10396bb20 [Heap] Convert min() and max() to properties 2023-11-14 18:52:27 -08:00
Karoy Lorentey c44d56f4c8 Merge pull request #327 from lorentey/heap-better-bulk-insert
[Heap] insert(contentsOf:) Switch to Floyd’s if we’re inserting too many items
2023-11-14 17:56:22 -08:00
Karoy LorenteyandStephen Canon 19ec155f60 Update Sources/HeapModule/Heap.swift
Co-authored-by: Stephen Canon <stephentyrone@gmail.com>
2023-11-14 11:06:05 -08:00
Karoy Lorentey 069dd4e5df [Heap] insert(contentsOf:) Switch to Floyd’s if we’re inserting too many items 2023-11-13 21:28:24 -08:00
Karoy Lorentey 7686af1555 [Heap] Improve type-level doc comment 2023-11-13 18:33:43 -08:00
Karoy Lorentey a8dad62bc9 Remove obsolete swift(>=5.5)/swift(>=5.6) checks 2023-04-10 18:33:52 -07:00
Karoy Lorentey cc181a3bce HeapModule: _Node → _HeapNode
This makes this name unique throughout the package, allowing this code to be built as a single, huge module.
2023-03-21 16:39:03 -07:00
Karoy Lorentey fbebb69a1b [Heap] Doc updates 2022-10-13 14:50:18 -07:00
Karoy Lorentey 1228e9c162 [Heap] Update docs for replaceMin/replaceMax 2022-10-12 16:01:48 -07:00
Karoy Lorentey 7138144f37 [Heap] Remove unnecessary testing APIs
We do not need a _raw initializer in the Heap implementation. The
heapify algorithm will not modify storage if it’s already in the
expected shape, so we can simply define one locally that double checks
that the order remains unchanged.
2022-10-12 16:01:23 -07:00
Karoy Lorentey 92d808d179 Merge branch 'heap-replace-extrema' into release/1.1 2022-10-12 15:23:17 -07:00
Karoy Lorentey 33b759b842 [Heap] PriorityQueueModule → HeapModule 2022-10-09 15:44:44 -07:00