1. sort the pairs with key as one of the parameters
2. find the longest increasing sub-sequence (not necessarily
contiguous) from the sorted list with key the the other parameter.

Sachin

On Mar 1, 3:02 pm, bittu <shashank7andr...@gmail.com> wrote:
> A circus is designing a tower routine consisting of people standing
> atop one another’s
> shoulders. For practical and aesthetic reasons, each person must be
> both shorter and lighter than the person below him or her. Given the
> heights and weights of each person in the circus, write a method to
> compute the largest possible number of people
> in such a tower.
>
> for example
> Input (ht, wt): (65, 100) (70, 150) (56, 90) (75, 190) (60, 95) (68,
> 110)
> output..??
>
> Thanks & Regards
> Shashank

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to