handle-methods: Get the handles and values for nodes of a specific key in a...

Description Usage Arguments Value Examples

Description

Returns a list of handles and values for node elements that have a specific key. That means for a given key, the reference to the node (the handle) as well as the value of the node are returned. If one key fits fits multiple nodes, all of the values and handles are returned. This is needed in order to uniquely identify a node if, for example, decrease_key on a specific node is going to be called.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
handle(obj, key, value)

## S4 method for signature 'heap,vector,missing'
handle(obj, key)

## S4 method for signature 'heap,missing,list'
handle(obj, value)

## S4 method for signature 'heap,missing,vector'
handle(obj, value)

## S4 method for signature 'heap,missing,matrix'
handle(obj, value)

Arguments

obj

a heap object

key

a key in the heap

value

a value in the heap

Value

returns extracted handles and values from obj

Examples

1
2
3
4
5
6
7
 # returns the handle of a heap
 f_heap <- fibonacci_heap("integer")
 f_heap <- insert(f_heap, 1:5, letters[1:5])

 handle(f_heap, key=3L)

 handle(f_heap, value=letters[3])

datastructures documentation built on Aug. 10, 2020, 5:08 p.m.