restructure(nodesToRestructure) {
    const x = nodesToRestructure[0];
    const y = nodesToRestructure[1];
    const z = nodesToRestructure[2];

    // Determine Rotation Pattern
    if (z.right === y && y.right === x) {
      this.rightRight(x, y, z);
    } else if (z.left === y && y.left === x) {
      this.leftLeft(x, y, z);
    } else if (z.right === y && y.left === x) {
      this.rightLeft(x, y, z);
    } else if (z.left === y && y.right === x) {
      this.leftRight(x, y, z);
    }
  }
Identifies and calls the appropriate pattern
rotator.