Re: [algogeeks] Least Common Ancestor in STL MAP

2013-03-22 Thread Shashwat Anand
On 3/21/13 5:02 PM, Avinash wrote: Given a STL map, say mapint, bool m1. Given two value a b that may or may not exists in m1. Find the Least Common Ancestor in STL MAP. Remember you don't have access to root, so you need to iterate using iterator. Use the methods/function of MAP forex begin,

[algogeeks] Least Common Ancestor in STL MAP

2013-03-21 Thread Avinash
Given a STL map, say mapint, bool m1. Given two value a b that may or may not exists in m1. Find the Least Common Ancestor in STL MAP. Remember you don't have access to root, so you need to iterate using iterator. Use the methods/function of MAP forex begin, end, find etc. Solution should be