![]() |
Bridges-Python-3.0.2
3.0.2
Bridges(PythonAPI)
|
The BSTElement class is the building block for creating binary search trees.
The BSTElement class is the building block for creating binary search tree structures. It contains two children (viz., left, right), and a search key, to be used in search operations .
BSTElement contains a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.
BST Elements also have a LinkVisualizer object, that is used when they are linked to another element, appropriate for setting link attributes, for instance, between the current element and its left or right child
This class extends the BinTreeElement class by adding a 'key' value for use in a binary search tree implementations.
Binary Search Tree tutorial, http://bridgesuncc.github.io/tutorials/BinarySearchTree.html
Public Member Functions | |
def | __init__ (self, kwargs) |
Constructor bst element. More... | |
def | get_data_structure_type (self) |
Get the data structure representation. More... | |
def | key (self) |
Getter for the bst element key. More... | |
def | key |
Setter for the bst element key. More... | |
def | left (self) |
Getter for the left element in BST. More... | |
def | left (self, l) |
Setter for the left element in BST. More... | |
def | right (self) |
Getter for the right child in BST. More... | |
def | right (self, r) |
Setter for the right element in BST. More... | |
def | get_element_representation (self) |
Augment the element with the "key" field. More... | |
![]() | |
def | __init__ (self, kwargs) |
Constructor for an empty Binary Tree Element. More... | |
def | get_data_structure_type (self) |
Get the data structure type. More... | |
def | left (self) |
Getter for the left element for the binary tree. More... | |
def | left (self, l) |
Setter for the left element of a binary tree. More... | |
def | right (self) |
Getter for the right element for the binary tree. More... | |
def | right (self, r) |
Setter for the right element of a binary tree. More... | |
![]() | |
def | __init__ (self, kwargs) |
Constructor for Tree Element. More... | |
def | get_data_structure_type (self) |
Gets the data structure type. More... | |
def | add_child (self, child) |
Adds a child to this parent node. More... | |
def | get_number_of_children (self) |
Get the number of children at this node. More... | |
def | set_child |
Adds a child to the node that will be added at the next open position. More... | |
def | get_child |
Gets a child at particular index. More... | |
def | get_data_structure_representation (self) |
Get the hierarchical JSON of the tree representation (internal use only) More... | |
![]() | |
def | get_data_structure_type (self) |
Get the data structure representation. More... | |
def | __init__ (self, kwargs) |
def | value (self) |
Getter for the value this element is holding. More... | |
def | value (self, val) |
Setter for the value of an element. More... | |
def | identifier (self) |
Getter for the element identifier. More... | |
def | identifier |
Setter for the element identifier. More... | |
def | visualizer (self) |
Getter for the element visualizer. More... | |
def | visualizer |
Setter function for this element visualizer. More... | |
def | get_link_visualizer (self, el) |
def | set_link_visualizer (self, el) |
Setter for the link visualizer of this element. More... | |
def | remove_link_visualizer (self, el) |
Deleter function for the lik visualizer of this element. More... | |
def | label (self) |
Getter for the element's label. More... | |
def | label (self, label) |
Setter for the element's label. More... | |
def | size (self) |
Getter for the element's size. More... | |
def | size (self, sz) |
Setter for the element's size. More... | |
def | color (self) |
Getter for the element's color. More... | |
def | color (self, col) |
Setter for the element's size. More... | |
def | opacity (self) |
Getter for the element's opacity. More... | |
def | opacity (self, op) |
Setter for the element's opacity. More... | |
def | shape (self) |
Getter for the element's shape type. More... | |
def | shape (self, shp) |
Setter for the element's shape. More... | |
def | id (self) |
def | set_location (self, locX, locY) |
Setter for the element's location. More... | |
def | get_locationX (self) |
Getter for the element's location in X. More... | |
def | get_locationY (self) |
Getter for the element's location in Y. More... | |
def | get_element_representation (self) |
Getter for the element's JSON representation (for internal use) More... | |
def | get_link_representation (self, lv, src, dest) |
Getter for the JSON representation of the element's link (for internal use) More... | |
Additional Inherited Members | |
![]() | |
children | |
![]() | |
color | |
opacity | |
![]() | |
string | QUOTE = "\"" |
string | COMMA = "," |
string | COLON = ":" |
string | OPEN_CURLY = "{" |
string | CLOSE_CURLY = "}" |
string | OPEN_PAREN = "(" |
string | CLOSE_PAREN = ")" |
string | OPEN_BOX = "[" |
string | CLOSE_BOX = "]" |
![]() | |
int | ids = 0 |
def bridges.bst_element.BSTElement.__init__ | ( | self, | |
kwargs, | |||
None | |||
) |
Constructor bst element.
(str) key: The label for the tree element that shows in visualization (generic) e: the generic object that the tree element will hold (BinTreeElement) left: the tree element assigned to child 0 (BinTreeElement) right: the tree element assigned to child 1
def bridges.bst_element.BSTElement.get_data_structure_type | ( | self, | |
str | |||
) |
Get the data structure representation.
def bridges.bst_element.BSTElement.get_element_representation | ( | self, | |
dict | |||
) |
Augment the element with the "key" field.
def bridges.bst_element.BSTElement.key | ( | self, | |
str | |||
) |
Getter for the bst element key.
def bridges.bst_element.BSTElement.key | ( | self, | |
k | |||
) |
Setter for the bst element key.
key | the key for the element |
def bridges.bst_element.BSTElement.left | ( | self | ) |
Getter for the left element in BST.
def bridges.bst_element.BSTElement.left | ( | self, | |
l | |||
) |
Setter for the left element in BST.
l | the value for the left child to be set as |
def bridges.bst_element.BSTElement.right | ( | self | ) |
Getter for the right child in BST.
def bridges.bst_element.BSTElement.right | ( | self, | |
r | |||
) |
Setter for the right element in BST.
r | the value for the right child to be set as |