>I don't want to mess with a bunch of functions to access the variables when I'm trying to figure out how to make binary trees for the first time.

Yet you want your tree to have left, right, sibling, parent, and left/right level pointers? A bunch of functions will not make your job harder if that's your goal.

It appears as if you want to build a perfect tree based on the height given. A full and perfect binary tree of height 4 has 15 nodes, 2^n - 1. However, you're going about it in the wrong way, really. Whether you like it or not, an insertion function is by far the easiest way to build a tree because you can use recursion to simplify things:

Code:

struct node {
int data;
node *left;
node *right;
public:
node ( int init, node *llink, node *rlink )
: data ( init )
, left ( llink )
, right ( rlink )
{}
};
node *insert ( node *root, int data )
{
if ( root == 0 )
root = new node ( data, 0, 0 );
else if ( data < root->data )
root->left = insert ( root->left, data );
else
root->right = insert ( root->right, data );
return root;
}

Then to build a complete balanced tree, you find out how many nodes a tree of height n would have and build an array with that many items. You want an array so that each node can have a distinct value. That way you know that everything is working properly, instead of simply hoping as you look at a tree full of the same value.

The hardest part is actually building the tree. If you can binary search an array then you should have no difficulty. Play with this to get yourself started:

Code:

#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
struct node {
int data;
node *left;
node *right;
public:
node ( int init, node *llink, node *rlink )
: data ( init )
, left ( llink )
, right ( rlink )
{}
};
node *insert ( node *root, int data )
{
if ( root == 0 )
root = new node ( data, 0, 0 );
else if ( data < root->data )
root->left = insert ( root->left, data );
else
root->right = insert ( root->right, data );
return root;
}
void build_tree ( node*& root, int *range, int left, int right )
{
int mid = left + ( right - left ) / 2;
if ( left > right )
return;
root = insert ( root, range[mid] );
build_tree ( root, range, left, mid - 1 );
build_tree ( root, range, mid + 1, right );
}
void print_node ( int value, int level )
{
for ( int i = 0; i < level; i++ )
printf ( "\t" );
printf ( "%d\n", value );
}
void tree_structure ( node *node, int level )
{
if ( node == NULL )
print_node ( -1, level );
else {
tree_structure ( node->right, level + 1 );
print_node ( node->data, level );
tree_structure ( node->left, level + 1 );
}
}
int main()
{
int height;
int nnodes;
int *range = 0;
node *root = 0;
cout<<"Enter the height of the tree: ";
if ( !( cin>> height ) ) {
cerr<<"Sorry, invalid input\n";
return EXIT_FAILURE;
}
nnodes = (int)pow ( 2, height ) - 1;
range = new int[nnodes];
for ( int i = 0; i < nnodes; i++ )
range[i] = i;
build_tree ( root, range, 0, nnodes - 1 );
delete [] range;
tree_structure ( root, 0 );
}

Since you are just starting with binary trees, I highly recommend you figure out the basics before adding additional links to the tree, they just make things more complicated. You can also see my tutorial in basic binary search trees in the FAQ.