Skip to content

Naming in single rotations in AVL tree representation #15

@ristovskiv

Description

@ristovskiv

I think the naming of the functions

var rotationLL = function(node) {
    var tmp = node.left;
    node.left = tmp.right;
    tmp.right = node;

    return tmp;
};

var rotationRR = function(node) {
    var tmp = node.right;
    node.right = tmp.left;
    tmp.left = node;

    return tmp;
};

is wrong. By my understanding of AVL rotations, the names of the functions actually need to be swapped. So the function rotationLL will be rotationRR and vice versa. If this is confirmed I don't mind making a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions