堆栈
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | len | = | 0 |
number of nodes in the stack_int |
push an item to the stack_int
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(stack_int), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | item |
pop an item from the stack_int
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(stack_int), | intent(inout) | :: | self | |||
integer, | intent(out), | optional | :: | item |
Get an stack_int_iterator for the stack_int
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(stack_int), | intent(in) | :: | self |
Clear the stack_int
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(stack_int), | intent(inout) | :: | self |
type stack_int
private
integer, public :: len = 0 !! number of nodes in the stack_int
type(node), pointer :: head => null() !! head of the stack_int
type(node), pointer :: tail => null() !! tail of the stack_int
contains
procedure :: push => stack_int_push
procedure :: pop => stack_int_pop
procedure :: iterator
procedure :: clear => stack_int_clear
end type stack_int