The wasBinarySearchTreeSuccessor function takes as arguments:

  • a binary search tree (BST) as a flattened list as per binary_trees.
  • the node (node) to find the successor of.

and returns the in-order successor of the specified node in the binary search tree.


This script was tested and works on OpenSim version 0.7.5!

//    Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3    //
string wasBinarySearchTreeSuccessor(list BST, string node) {
    string right = wasBinaryTreeRight(BST, node);
    if(right != "") return wasBinarySearchTreeMinimum(BST, right);
    string parent = wasBinaryTreeParent(BST, node);
    while(parent != "" && node == wasBinaryTreeRight(BST, parent)) {
        node = wasBinaryTreeParent(BST, node);
        parent = wasBinaryTreeParent(BST, parent);
    return parent;

secondlife/binary_trees/binary_search_trees/successor.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p

For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy, data protection and copyright compliance.