structs package

Submodules

structs.stack module

class structs.stack.Stack

Bases: Generic[T]

A generic stack implementation.

is_empty() bool
peek() T
pop() T
push(item: T) None
size() int

structs.tree module

class structs.tree.BinaryTreeNode(value, left=None, right=None)

Bases: object

A class representing a node in a binary tree.

Attributes:

__value: The value of the node. __left: The left child of the node. __right: The right child of the node.

classmethod copy(node)

Creates a new copy of the given node.

classmethod deep_copy(node)

Creates a new deep copy of the given node.

getLeft()
getRight()
getValue()
isValue(value)

Checks if the node value is an instance of a class of the given value and compares the value.

is_id()

” Returns true if the node value is an identifier.

is_name()

Returns true if the node value is a name.

setLeft(left)
setRight(right)
setValue(value)
class structs.tree.TreeFormatter

Bases: object

A class that provides a method to represent a tree structure in the specified format.

static line_str(node, level)

Module contents