[algogeeks] No of triangles

2011-12-04 Thread payel roy
You have been given a number n. If you have to divide n into 3 parts so that you can build a tri-angle. Given n, how many will be possible? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] No of triangles

2011-12-04 Thread Dipit Grover
http://susam.in/downloads/mathematics/theorems/integer-triangles-with-fixed-perimeter.pdf -- Dipit Grover B.Tech in Computer Science and Engineering - lllrd year IIT Roorkee, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] No of triangles

2011-12-04 Thread pankajsingh
sorryi was thinking n as number of nodes... -- 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

Re: [algogeeks] No of triangles

2011-12-04 Thread pankajsingh
yours question is slightly unclear.,if u need to count all possible number of triangle,why i need to divide in 3 parts...,what i think u r looking for is dividing in 3 parts which give me maximum number of possible triangleif it is so, divide in more or less equal parts...

Re: [algogeeks] Re: facebook interview question

2011-12-04 Thread Ashish Goel
wouldn't a binary tree do? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Nov 29, 2011 at 3:17 AM, Dave dave_and_da...@juno.com wrote: @Atul: Your code uses 2*n - 2 comparisons. Thus, it is non-responsive to the problem of using something

Re: [algogeeks] Re: facebook interview question

2011-12-04 Thread Ashish Goel
Binary tree is 2n-2 this question was asked in MS also... Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Dec 4, 2011 at 4:59 PM, Ashish Goel ashg...@gmail.com wrote: wouldn't a binary tree do? Best Regards Ashish Goel Think positive

[algogeeks] Re: Removing Duplicates In array and Linked list

2011-12-04 Thread WgpShashank
@kumar ,dave .. there is ony one way to do it if numbers are in range , otherwise its not possible yo remove the duplicates from both array linkedlist which are unsorted ? what's u say ? Thanks Shashank Computer Science, BIT Mesra -- You received this message because you are subscribed to

Re: [algogeeks] facebook interview question

2011-12-04 Thread Anika Jain
refer algorithms by cormen for this On Mon, Nov 28, 2011 at 9:56 PM, Nitin Garg nitin.garg.i...@gmail.comwrote: Find the min and max in an array. Now do it in less than 2n comparisons. (they were looking for the solution that finds both max and min in about 3/2 n comparisons). -- Nitin

[algogeeks] Fill tool

2011-12-04 Thread rajesh ko
We have given a black and white image and a fill tool that turn an area of black pixel into white pixels. Fill tool works like a 8-way floodfill tool.So it will turn each black pixel to a white pixel untill there isn't a blackpixel that can be reached from the previous pixel. (8 ways -

Re: [algogeeks] facebook interview question

2011-12-04 Thread Deepak Nettem
Greetings! The strategy should be to process the elements in pairs - and compare the larger element with current maximum, and smaller element with current minimum. loop runs upto n in steps of 2, and in each iteration, there are 3 comparisons: - between (i)th and (i+1)th element - between min(i,

Re: [algogeeks] Fill tool

2011-12-04 Thread sunny agrawal
http://www.gild.com/challenges/details/295 No of connected components, use BFS/DFS On Sun, Dec 4, 2011 at 9:12 PM, rajesh ko ko.rajes...@gmail.com wrote: We have given a black and white image and a fill tool that turn an area of black pixel into white pixels. Fill tool works like a 8-way

[algogeeks] Thanks to Algogeeks

2011-12-04 Thread kumar raja
I am selected in Oracle Server Technologies today The questions are not much from algorithms But i have learned a lot of things from this group on algorithms Especially Dave sir Thanks once again -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in -- You received this

[algogeeks] Re: Thanks to Algogeeks

2011-12-04 Thread Dave
@Kumar. Congratulations. Happy to be of help. Dave On Dec 4, 12:49 pm, kumar raja rajkumar.cs...@gmail.com wrote: I am selected in Oracle Server Technologies today The questions are not much from algorithms But i have learned a lot of things from this group on algorithms Especially Dave

[algogeeks] Re: No of triangles

2011-12-04 Thread Dave
@Payel: I think you are asking how many triangles you can form with integer sides and perimeter n. See http://oeis.org/A005044 for several formulas and for references. Dave On Dec 4, 2:41 am, payel roy smithpa...@gmail.com wrote: You have been given a number n. If you have to divide n into 3

Re: [algogeeks] Re: Thanks to Algogeeks

2011-12-04 Thread kumar raja
Thank u sir On 5 December 2011 09:27, Dave dave_and_da...@juno.com wrote: @Kumar. Congratulations. Happy to be of help. Dave On Dec 4, 12:49 pm, kumar raja rajkumar.cs...@gmail.com wrote: I am selected in Oracle Server Technologies today The questions are not much from algorithms

[algogeeks] Java Collections

2011-12-04 Thread DT
Hi I have a Person Object that has members: firstname, lastname and DOB public class Person { private String firstName; private String lastName; private Date dob; /** Construct a Person given the first name, last name, and birth date. */ public Person(String firstName, String

[algogeeks] Java Collections

2011-12-04 Thread pa7751
Hi I have a Person Object that has members: firstname, lastname and DOB public class Person { private String firstName; private String lastName; private Date dob; /** Construct a Person given the first name, last name, and birth date. */ public Person(String firstName, String

Re: [algogeeks] Re: Interview question

2011-12-04 Thread Algoose chase
n = x%2 ? x can be any integer. On Fri, Dec 2, 2011 at 5:19 PM, Don dondod...@gmail.com wrote: (!x || !(x^1)) !(x1) !((x|1)-1) (x*x)==x (x==(x==x))||(x==(x!=x)) etc. On Nov 29, 9:07 pm, Nitin Garg nitin.garg.i...@gmail.com wrote: *What are the different ways to say, the value of x

[algogeeks] Maximal possible subsets Algorithm

2011-12-04 Thread Piyush Grover
Given a set S of objects having weights Wi and values Vi, and given a maximum weight Wmax. Find *ALL* the maximal subsets of set S such that Sum(Wi) = Wmax. Maximal subset means if {a, b, c} is a solution (such that Wa+Wb+Wc = Wmax) it means there doesn't exist any other object x in S such that