[algogeeks] Re: Area of Intersection between Oriented Rectangles

2008-06-02 Thread nima aghdaie
Some ideas: - Divide each of the rectangles into 2 triangles, then calculate each 2 triangles intersection(from opposing rectangles). - Use "line sweep" method. - Ucse convex-polygon intersection method mentioned in almost every computational geometry book.(or find some on the inter

[algogeeks] Re: Plannar graph

2008-03-25 Thread nima aghdaie
what's the problem?! K4 does not contain K3,3 or K5 => K4 is planar! On Tue, Mar 25, 2008 at 5:42 PM, Karthik Singaram Lakshmanan < [EMAIL PROTECTED]> wrote: > > K4 is planar > http://en.wikipedia.org/wiki/Planar_graph > > > > --~--~-~--~~~---~--~~ You received

[algogeeks] Re: Plannar graph

2008-03-24 Thread nima aghdaie
A graph is planar iff it does not contain K5 and K3,3 . read chapter 6 (Planar Graphs) from "Introduction to Graph Theory", Douglas B. West 2008/3/24 kunzmilan <[EMAIL PROTECTED]>: > > > > On 17 Bře, 10:38, sp1 <[EMAIL PROTECTED]> wrote: > > How to test an given graph is plannar? > > The answer

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Nima Aghdaie
h the largest weight Well, we need to return the *node* which is at the root of the subtree with the largest weight. On Jan 29, 4:40 am, "Nima Aghdaie" <[EMAIL PROTECTED]> wrote: > int maxw(node root) > { >         if(root == null) return (0); >         int L = maxw(ro

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Nima Aghdaie
int maxw(node root) { if(root == null) return (0); int L = maxw(root.lchild); int R = maxw(root.rchild); return max( (max(R,L,R+L)+root.value), R, L, root.value ); } -Original Message- From: algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] On Beha

[algogeeks] Re: subset with maximum sum.

2007-10-13 Thread nima aghdaie
read Kadane's Algo. On 10/13/07, kannan <[EMAIL PROTECTED]> wrote: > > > hellow! > here is the problem statement. > you have to find the subset having the maximum sum in the given array > of +ve and -ve numbers. > try not to foll

[algogeeks] Re: Testing if 3 points form a triangle

2007-06-04 Thread nima aghdaie
use the cross product to examine whether they're collinear. points A,B,C: AB*BC =? 0 On 5/27/07, Feng <[EMAIL PROTECTED]> wrote: > > > Hi all! > > Given 3 points in 3D, what is the fast and numerically stable way to > test if they form a triangle? > > I am thinking computing the determinant of th