HeapNode#
- class HeapNode(key, priority)#
Bases:
LinkedListNode
,Generic
[_K
,_V
]- __init__(key, priority)#
Constructor of the HeapNode class.
- Parameters:
key (_K) – Key to represent the node.
priority (_V) – Numeric priority with respect to which the heap property is maintained.
Methods
__init__
(key, priority)Constructor of the HeapNode class.
add_child
(child)- rtype:
None
add_parent
(key, priority)- rtype:
None
add_predecessor
(value)- rtype:
None
add_successor
(value)- rtype:
None
change_children_root
(new_child_root)- rtype:
None
change_degree
(new_degree)- rtype:
None
change_parent
(new_parent)- rtype:
None
change_predecessor
(new_predecessor)- rtype:
None
change_priority
(new_priority)- rtype:
None
change_successor
(new_successor)- rtype:
None
create_and_add_child
(key, priority)- rtype:
None
- rtype:
None
- rtype:
None
new_node
(value)- rtype:
TypeVar
(LLN
, bound=LinkedListNode
)
remove_child
(child)- rtype:
None
- rtype:
None
- rtype:
None
- rtype:
None
- rtype:
None
- rtype:
None
set_mark
(mark)- rtype:
None
Attributes
- rtype:
Optional
[HeapNode
]
- rtype:
int
- rtype:
TypeVar
(_K
)
- rtype:
bool
- rtype:
Optional
[HeapNode
]
- rtype:
Optional
[TypeVar
(LLN
, bound=LinkedListNode
)]
- rtype:
TypeVar
(_V
, bound=Comparable
)
- rtype:
Optional
[TypeVar
(LLN
, bound=LinkedListNode
)]
- rtype:
TypeVar
(T
)
- add_child(child)#
- Return type:
None
- add_parent(key, priority)#
- Return type:
None
- add_predecessor(value)#
- Return type:
None
- add_successor(value)#
- Return type:
None
- change_children_root(new_child_root)#
- Return type:
None
- change_degree(new_degree)#
- Return type:
None
- change_parent(new_parent)#
- Return type:
None
- change_predecessor(new_predecessor)#
- Return type:
None
- change_priority(new_priority)#
- Return type:
None
- change_successor(new_successor)#
- Return type:
None
- create_and_add_child(key, priority)#
- Return type:
None
- decrement_degree()#
- Return type:
None
- property degree: int#
- Return type:
int
- increment_degree()#
- Return type:
None
- property key: _K#
- Return type:
TypeVar
(_K
)
- property mark: bool#
- Return type:
bool
- classmethod new_node(value)#
- Return type:
TypeVar
(LLN
, bound=LinkedListNode
)
- property predecessor: Optional[LLN]#
- Return type:
Optional
[TypeVar
(LLN
, bound=LinkedListNode
)]
- property priority: _V#
- Return type:
TypeVar
(_V
, bound=Comparable
)
- remove_child(child)#
- Return type:
None
- remove_children()#
- Return type:
None
- remove_children_root()#
- Return type:
None
- remove_parent()#
- Return type:
None
- remove_predecessor()#
- Return type:
None
- remove_successor()#
- Return type:
None
- set_mark(mark)#
- Return type:
None
- property successor: Optional[LLN]#
- Return type:
Optional
[TypeVar
(LLN
, bound=LinkedListNode
)]
- property value: T#
- Return type:
TypeVar
(T
)