CFanatic

Go Back   CFanatic > Programming > C Programming

Join CFanatic Forum Now

finding lowest common ancestor in binary search tree topic posted under C Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2008, 10:17 PM
Junior Member
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
cuterocker is on a distinguished road
| More
Thumbs up finding lowest common ancestor in binary search tree

1. Write a program to print Lowest Common Ancestor of given the values of two nodes in a binary search tree. You may assume that both values already exist in the tree.

The program should take the inputs for the binary tree and construct the tree. Once the construction is over, the program takes 2 inputs to find out the LCA of those nodes.

Eg: In the below given tree, the lowest common ancestor of 4 and 14 is 8.
Attached Images
File Type: jpg untitled.JPG (15.8 KB, 18 views)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
In search of interesting forums. lyslesupe Sell Your Code 1 10-07-2008 11:06 PM
Common XP look and feel imaginative.bibhas MFC Programming 3 07-21-2008 03:37 AM
Highly recommend Lowest Domain:.CN $0.14&.COM $6.62 Bettypeng Sell Your Code 0 03-11-2008 04:20 AM
Remove complete folder tree pemo Win32 Programming 2 12-10-2006 02:07 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:12 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board