Wednesday, August 15, 2007

Write a C program to find the mininum value in a binary search tree.

Here is some sample C code. The idea is to keep on moving till you hit the left most node in the tree


int minValue(struct node* node)
{
struct node* current = node;

while (current->left != NULL)
{
current = current->left;
}

return(current->data);
}


On similar lines, to find the maximum value, keep on moving till you hit the right most node of the tree.

10 comments:

  1. If you would like to increase your experience just keep visiting this web site and be updated with the most up-to-date information posted here.



    my blog post selling a wrecked car

    ReplyDelete
  2. Wondеrful site yоu haνe here but I was wonԁerіng іf
    you κnew of any dіscuѕsion boardѕ that cover the ѕаme toρics talκed
    abοut in this artіcle? I'd really love to be a part of group where I can get feedback from other knowledgeable individuals that share the same interest. If you have any recommendations, please let me know. Cheers!

    Also visit my homepage: cash for cars phoenix :: smartsolutions123.com ::

    ReplyDelete
  3. After exploring a handful of the articles on your web site, I
    really like your way of writing a blog. I saved as a favorite it to my bookmark website list and
    will be checking back in the near future. Please visit my web site too
    and let me know your opinion.

    My web page ... selling a car in florida

    ReplyDelete
  4. Very nісe article, totally what I was lоokіng for.


    Μу hоmepаge - buу cаrs for cаsh ()

    ReplyDelete
  5. This post will assist thе іnternet vіewers for buіlding up new
    blog or even а weblog from ѕtагt
    to end.

    my webѕіte - cash fоr cars surrey [projectwiki.Herlig.net]

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. I liked your posts, I was wondering why such good content is not monetised are u waiting for adsense approval.I have found another alternative ads http://tinyurl.com/zl83sk9 works fine for my blog http://basicsofvlsi.blogspot.in/

    ReplyDelete