IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

FixedHeightMinHeap

struct FixedHeightMinHeap[k_dtype: DType, v_dtype: DType, levels: Int]

Fields​

  • ​k_array (InlineArray[Scalar[k_dtype], FixedHeightMinHeap[k_dtype, v_dtype, levels].num_elements]):
  • ​v_array (InlineArray[Scalar[v_dtype], FixedHeightMinHeap[k_dtype, v_dtype, levels].num_elements]):

Implemented traits​

AnyType, ImplicitlyDestructible

comptime members​

num_elements​

comptime num_elements = ((2 ** levels) - 1)

Methods​

__init__​

def __init__(out self, *, fill_k: Scalar[k_dtype], fill_v: Scalar[v_dtype])

swap​

def swap(mut self, a: Int, b: Int)

heap_down​

def heap_down(mut self)