main
Download
39 lines 861 BGroffModified 2026-03-09 raw
123456789101112131415161718192021222324252627282930313233343536373839
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH List.heap_push 3 2026-03-08 "Tomo man-pages"
.SH NAME
List.heap_push \- heap push
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.heap_push\ :\ func(list:\ @[T],\ item:\ T,\ by\ =\ T.compare\ ->\ Void)
.fi
.SH DESCRIPTION
Adds an element to the heap and maintains the heap property. By default, this is a *minimum* heap.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
list	@[T]	The mutable reference to the heap. 	-
item	T	The item to be added. 	-
by		The comparison function used to determine order. If not specified, the default comparison function for the item type will be used. 	T.compare
.TE
.SH RETURN
Nothing.

.SH EXAMPLES
.EX
my_heap : &[Int]
my_heap.heap_push(10)
assert my_heap.heap_pop() == 10
.EE
.SH SEE ALSO
.BR Tomo-List (3)