Description

Returns the right node of a given node.

The index of the right node of a specified node is calculated as being:

$$
\text{index(right node)} = 2*\text{index(specified node)}+2
$$

Code

This script was tested and works on OpenSim version 0.7.5!

///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
string wasBinaryTreeRight(list BT, string node) {
    // Right child index: 2*i + 2
    integer i = llListFindList(BT, (list)node);
    if(i == -1) return "";
    return llList2String(BT, 2*i+2);
}

secondlife/binary_trees/right.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


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