Re: [algogeeks] Re: ARICENT PATTERN

2012-02-26 Thread vivek kumar
hey guys any one have idea about aricent online paper .. plzzz tell me thankss On Sat, Feb 25, 2012 at 8:25 PM, vivek kumar kumarvivek1...@gmail.comwrote: can u provide me some question On Thu, Feb 23, 2012 at 1:59 AM, saurabh tripathi sonu6...@gmail.comwrote: Question in each section

Re: [algogeeks] Re: ARICENT PATTERN

2012-02-26 Thread sunny agrawal
this is not the right place to ask such queries On Sun, Feb 26, 2012 at 5:38 PM, vivek kumar kumarvivek1...@gmail.comwrote: hey guys any one have idea about aricent online paper .. plzzz tell me thankss On Sat, Feb 25, 2012 at 8:25 PM, vivek kumar kumarvivek1...@gmail.comwrote: can u

Re: [algogeeks] Re: ARICENT PATTERN

2012-02-26 Thread rahul sharma
even i was banned arlier for these typ of queries On Sun, Feb 26, 2012 at 5:39 PM, sunny agrawal sunny816.i...@gmail.comwrote: this is not the right place to ask such queries On Sun, Feb 26, 2012 at 5:38 PM, vivek kumar kumarvivek1...@gmail.comwrote: hey guys any one have idea about aricent

[algogeeks] Re: google question

2012-02-26 Thread Dumanshu
You are assuming is to be a binary tree, its not. Some nodes will share a common pour. On Feb 25, 9:24 pm, atul anand atul.87fri...@gmail.com wrote: i guess this would work... n=number of nodes h=height; pour=quantity poured; capacity = capacity of each cup n=pow(2,h+1) -1;

[algogeeks] Pbm with rand() function

2012-02-26 Thread karthikeya s
RAND() func returns value between 1 to INTMAX, as we know. But when smone tries to find out value between 1 to N he takes remainder of o/p of RAND() with N and adds one..but isn't it wrong coz RAND() will generate numbers with equal probability between 1 and INTMAX but taking remainder can

[algogeeks] Re: Pbm with rand() function

2012-02-26 Thread Dave
@Karthikeya: Doesn't rand() actually return numbers in the range 0 to RANDMAX? Proceeding as if that is the case: If N is much smaller than RANDMAX, the process probably works well enough for most applications, but if you want numbers as good as the numbers rand() generates, do the following:

[algogeeks] Re: Pbm with rand() function

2012-02-26 Thread karthikeya s
int m = (RANDMAX / N) * N isn't m= RANDMAX simplyit couldn't understand the what is the logic here. -- 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

[algogeeks] generate random number

2012-02-26 Thread karthikeya s
Assuming we have an implementation of RANDOM(0.1), how can we implement RANDOM(a.b) - i.e. given we have a function that returns 0 OR 1 both with a probability of 1/2, how can we implement a function that returns integers from a to b (b a), all with a probability of 1/ n, where n = (b-a+1) my

[algogeeks] Re: Constructing Binary Tree from a sorted Doubly Linked List

2012-02-26 Thread Gene
One way to think about it: Given an input list with n items, consume the first ceiling((n-1)/2)=floor(n/2) items building the left subtree. Then consume the next item to use for the new tree root. Then consume the rest of the elements, which number n - floor(n/2) - 1 to build the right subtree.

Re: [algogeeks] Re: google question

2012-02-26 Thread Ravi Ranjan
@all same doubt qstn appears to be of binary tree DS but the diagram given in between qstn is not like Binary tree so sharing is there so how sharing is done plz explain?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] Re: Pbm with rand() function

2012-02-26 Thread Dave
@Karthikeya: Integer division truncates. So m is the largest multiple of N that is less than or equal to RANDMAX. E.g., in your example, m = (50 / 30) * 30 = 1 * 30 = 30, since 50/30 truncates to 1. Dave On Feb 26, 12:33 pm, karthikeya s karthikeya.a...@gmail.com wrote: int m = (RANDMAX / N) *

[algogeeks] Re: generate random number

2012-02-26 Thread Dave
@Karthikeya: You accept that your for-loop generates a random integer between 0 and 2^d - 1, right? Then take a look at http://en.wikipedia.org/wiki/Rejection_sampling. Basically, you reject any random integer that exceeds b-a. The probability that you reject a number is 1 - (b - a + 1) / (2^d -

[algogeeks] Re: Pbm with rand() function

2012-02-26 Thread karthikeya s
oh my bad.really nice concept+1 dave. -- 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] Re: Pbm with rand() function

2012-02-26 Thread amrit harry
@dave +1.. :) On Mon, Feb 27, 2012 at 10:55 AM, karthikeya s karthikeya.a...@gmail.comwrote: oh my bad.really nice concept+1 dave. -- 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] Re: google question

2012-02-26 Thread atul anand
@Ravi: checkout this code...i have created tree where there is sharing of nodes.. here is my code :- please let me know is case you find any bug. #includestdio.h typedef struct tree{ int idx; float data; struct tree *left; struct tree *right; }node; node *createNode(int index) { node *temp;