Struct NativeMinHeap<T>
- Namespace
- Core.Collections
- Assembly
- Core.dll
Burst-compatible min-heap for priority queue operations. Used by pathfinding for efficient lowest-cost node extraction.
Performance:
- Push: O(log n)
- Pop: O(log n)
- Peek: O(1)
Memory: Pre-allocated NativeList, zero allocations during use.
public struct NativeMinHeap<T> where T : unmanaged, IComparable<T>
Type Parameters
T
Constructors
NativeMinHeap(int, Allocator)
public NativeMinHeap(int initialCapacity, Allocator allocator)
Parameters
initialCapacityintallocatorAllocator
Properties
Count
public int Count { get; }
Property Value
- int
IsCreated
public bool IsCreated { get; }
Property Value
- bool
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
Methods
Clear()
Clear all elements. O(1)
public void Clear()
Dispose()
public void Dispose()
Peek()
Return minimum element without removing. O(1)
public T Peek()
Returns
- T
Pop()
Remove and return minimum element. O(log n)
public T Pop()
Returns
- T
Push(T)
Push element onto heap. O(log n)
public void Push(T item)
Parameters
itemT