@maddy: The students should be assigned consecutive books only. That is, u
CANNOT assign book 1, 2 and 5 to a single student. either assign book 1, 2
and 3 or 1 and 2 or any such combination of consecutive numbers.
On Thursday, June 14, 2012 12:26:09 PM UTC+5:30, algogeek wrote:
In a
What is the expected number of throws of his die while it has N sides
so that each number is rolled at least once?
e.g
for n=2 ans 3.00
n=12 ans is 37.24...
i refrd to expectation tutuorial at
http://www.codechef.com/wiki/tutorial-expectation but still couldnt
get the logic...
any help?
--
could u explain how would you use a trie for this??
On Thursday, June 14, 2012 1:01:00 PM UTC+5:30, Mohit Rathi wrote:
Hi,
*There are two arrays of length 100 each. Each of these has initially n
(n=100)
elements. First array contains names and the second array contains numbers
such that
Store each of the words in array in a trie and mark the end of the word by
its corresponding entry in the second array. Now if u are searching for a
word it'll take O(length of word) if there is a mismatch at any point you
know the word is not present in array1 and add it to the trie or else
#includestdio.h
main()
{
int a[] = {0,1,2,3,4};
int *p[] = {a,a+1,a+2,a+3,a+4};
int **pp= p;
printf(%d, %d, %d , *pp-a, pp-p, **pp);
pp++;
pp++;;
++pp;
*++pp;
printf(%d, %d, %d , pp-p, *pp-a, **pp);
}
output:0 ,0 ,0 ,4 ,4 ,4
--
You received this message
*p[] is an array of pointers pointing to the address of array a[] .. i.e
p[0] pointing to a[0]..p[1] to a[1] and so on.
*pp is a pointer to a pointer. It is storing the address of array of
pointers p.
1. *pp gives value at pointed by p[0]. This is 'a'. So when 'a' is
subtracted from it, it
If you evaluate the expressions from right to left and print the result
from left to right , it will be clear.
On Thursday, June 14, 2012 11:41:04 AM UTC+5:30, Ajesh js wrote:
main()
{
int a=10,b=5;
printf(%d %d %d\n,a++,a,++a);
printf(%d %d %d\n,++b,b,b++);
}
output
This problem is similar to Coupan collector problem.
http://en.wikipedia.org/wiki/Coupon_collector%27s_problem
In your case the answer is
[image: For N-Dice ; \newline \sum_{i=1}^{N} N/i \newline for\; N =~2 ;
\newline \sum_{i=1}^{2} 2/i = 2/1 + 2/2 = 3 \newline]
Hope it helps!
--
Amitesh
Hi Guys,
*Problem: *Rearrange a given array with n elements, so that m places
contain the m smallest elements in ascending order.
*Solution 2:* using QuickSort method approach.
[image: n = r -p + 1]
[image: \bold{PARTIAL-QUICKSORT(A,p,r,m)}: \newline if\; pr \newline q
\leftarrow
just curious to know if this question is asked in any interviews? Google
interview?
--
Amitesh
On Sun, Jun 17, 2012 at 12:09 AM, Amitesh Singh singh.amit...@gmail.comwrote:
This problem is similar to Coupan collector problem.
http://en.wikipedia.org/wiki/Coupon_collector%27s_problem
In
I think this algorithm is used for calculating poset in graph.
On Sat, Jun 16, 2012 at 3:04 AM, Hemesh Singh hemesh.mn...@gmail.comwrote:
+ 1 for DK's solution. Is that a standard algorithm coz I feel like I have
heard it somewhere ??
On Mon, Aug 8, 2011 at 1:37 AM, DK divyekap...@gmail.com
Also, goto cannot jump across functions , which imposes a major setback
for its use in exception handling
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@ALL can be solved using segment tree . :-)
On Fri, Sep 2, 2011 at 9:49 AM, Anup Ghatage ghat...@gmail.com wrote:
I just checked Shashank's blog post. The Deque solution is awesome :)
--
Anup Ghatage
--
You received this message because you are subscribed to the Google Groups
Algorithm
13 matches
Mail list logo