Accessing a BST in a singly linked list
<p>Having a singly linked list with its nodes being BST's, what is the code in c++ which needs to be used in order for me to be able to access the elements of the BST?</p>

<pre><code>ifstream isd;

isd.open ( "book1.txt" );
while( !isd.eof (  ) ) {
    book b1;

    isd &gt;&gt; b1;
    b[i] = b1;
    i++;
}

isd.close (  );
int j = 0;

for( int k = 0; k &lt; 104; k++ ) {
    if( b[k].category == "adventure" )
        bcat[j].insert ( b[k] );
    if( b[k].category == "family" )
        bcat[j + 1].insert ( b[k] );
    if( b[k].category == "fiction" )
        bcat[j + 2].insert ( b[k] );
    if( b[k].category == "fun" )
        bcat[j + 3].insert ( b[k] );
    if( b[k].category == "history" )
        bcat[j + 4].insert ( b[k] );
    if( b[k].category == "horror" )
        bcat[j + 5].insert ( b[k] );
}

if( b[k].category == "mystery" )
    bcat[j + 6].insert ( b[k] );
if( b[k].category == "school" )
    bcat[j + 7].insert ( b[k] );
if( b[k].category == "science" )
    bcat[j + 8].insert ( b[k] );
if( b[k].category == "story" )
    bcat[j + 9].insert ( b[k] );
if( b[k].category == "suspence" )
    bcat[j + 10].insert ( b[k] );


for( int k = 0; k &lt; 11; k++ )
    sdb.insert ( bcat[k] );

BinNode &lt; Elem &gt; preorder ( BinNode &lt; Elem &gt; *subroot )
{
    if( subroot == NULL )
        break;
    book ele;

    return ele = subroot-&gt;val (  );
}

for( b1.setStart (  ); b1.getValue ( ro ); b1.next (  ) ) {
    b2 = ro.getroot (  );
    b3 = b2-&gt;val (  );
    if( r.Category == b3.category ) {   //compare titles in order to find the correct title 
    }
}
</code></pre>

<p>After reading from the file the <code>book</code>s..i inserted them into an array of bst depending on their category then i inserted them into the linked list. I just need to be able to access the nodes of the bst.</p>

<pre><code>BST&lt;string,book,titlebookcomp,bookcomp&gt; ro;
BinNode&lt;book&gt; b2;
book b3;
</code></pre>
