package core:container/priority_queue

Index

Types (1)
Constants (1)
Variables (0)

This section is empty.

Procedure Groups (0)

This section is empty.

Types

Priority_Queue ¶

Priority_Queue :: struct {}

Constants

DEFAULT_CAPACITY ¶

DEFAULT_CAPACITY :: 16

Variables

This section is empty.

Procedures

cap ¶

cap :: proc "odin" (pq: $Q/Priority_Queue($T)) -> int {…}

clear ¶

clear :: proc "odin" (pq: ^$Q/Priority_Queue($T)) {…}

default_swap_proc ¶

default_swap_proc :: proc "odin" ($T: typeid) -> proc "odin" (q: []typeid, i, j: int) {…}

destroy ¶

destroy :: proc "odin" (pq: ^$Q/Priority_Queue($T)) {…}

fix ¶

fix :: proc "odin" (pq: ^$Q/Priority_Queue($T), i: int) {…}
 

NOTE(bill): When an element at index 'i' has changed its value, this will fix the the heap ordering. This is using a basic "heapsort" with shift up and a shift down parts.

init ¶

init :: proc "odin" (pq: ^$Q/Priority_Queue($T), less: proc "odin" (x, y: $) -> bool, swap: proc "odin" (q: []$, i, j: int), capacity: int = DEFAULT_CAPACITY, allocator := context.allocator) {…}

init_from_dynamic_array ¶

init_from_dynamic_array :: proc "odin" (pq: ^$Q/Priority_Queue($T), queue: [dynamic]$, less: proc "odin" (x, y: $) -> bool, swap: proc "odin" (q: []$, i, j: int)) {…}

len ¶

len :: proc "odin" (pq: $Q/Priority_Queue($T)) -> int {…}

pop ¶

pop :: proc "odin" (pq: ^$Q/Priority_Queue($T), loc := #caller_location) -> (value: $) {…}

pop_safe ¶

pop_safe :: proc "odin" (pq: ^$Q/Priority_Queue($T), loc := #caller_location) -> (value: $, ok: bool) {…}

push ¶

push :: proc "odin" (pq: ^$Q/Priority_Queue($T), value: $) {…}

remove ¶

remove :: proc "odin" (pq: ^$Q/Priority_Queue($T), i: int) -> (value: $, ok: bool) {…}

reserve ¶

reserve :: proc "odin" (pq: ^$Q/Priority_Queue($T), capacity: int) {…}

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-06 21:11:36.722208700 +0000 UTC