Re: [algogeeks] Re: Boxes!!!

2010-07-21 Thread siddharth shankar
@Devendra

sorted sequence of boxes are :

box1 LBH - 7 8 9
box2 LBH - 6 7 8
box3 LBH - 3 7 2

Now longest decreasing sub-sequence of above will have all the three boxes
as box1 = box2 = box3 ( box[i] = box[j] if all L,B,H of box[i] are =
that of box[j] respectively .)

so ans = ( 3 ) all boxes 


On Tue, Jul 20, 2010 at 8:34 AM, Devendra Pratap Singh 
dpsingh.ii...@gmail.com wrote:

 @siddarth

 can u explain ur algo for

 box1 LBH - 7 8 9
 box2 LBH - 6 7 8
 box3 LBH - 3 7 2

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




-- 
siddharth shankar

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@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.



Re: [algogeeks] Boxes!!!

2010-07-19 Thread siddharth shankar
step :

1. Sorting LBH in decreasing order   first on L than on B and than on H
.

2. Now find longest decreasing sub-sequence of array of structures(LBH) .

correct me if I m wrong !!!

On Sun, Jul 18, 2010 at 11:44 PM, amit amitjaspal...@gmail.com wrote:

 Given a lot of cuboid boxes with different length, breadth and height.
 We need to find the maximum subset which can fit into each other.

 For example:
 If Box 1 has LBH as 7 8 9
 If Box 2 has LBH as 5 6 8
 If Box 3 has LBH as 5 8 7
 If Box 4 has LBH as 4 4 4

 then answer is 1,2,4

 A box can fit into another only and only if all dimensions of that is
 less than the bigger box.Rotation of boxes is not possible.

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




-- 
siddharth shankar

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@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.



Re: [algogeeks] Google Interview Question

2010-07-14 Thread siddharth shankar
O ( n^2 ) soln can be done 
step :

1 . sort array in n*log(n) .
2.  for every C from last find two number A  B such that A+B=C ...   O(
n^2 )
Total :- O(N^2)

can we improve it further ??  any help please 

On Wed, Jul 14, 2010 at 10:57 AM, Debajyoti Sarma sarma.debajy...@gmail.com
 wrote:

 An array contains the set of positive integer. Find the largest number
 c such that c=a+b where a,b,c are distinct number of the set?
 [Consider , reducing complexity]

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




-- 
siddharth shankar

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@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.