We can still improve this trie idea..
say we have urls like
www.google.com
www.goodbye.com
www.google.com/transliterate
www.goodstrain.com/good
we can subdivide everything under "www.goo"
I mean we can store each character as a node in a trie and call it
like a "URL dictionary"
On Wed, May 16,
The range 1 to n^2 is already sorted
On Sat, May 5, 2012 at 12:17 AM, Algobiz wrote:
> How to sort n numbers in the range of 1 to n^2 in O(n).. Any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the
@bharat: +1
On Thu, Apr 26, 2012 at 1:06 PM, bharat b wrote:
> create an array of linked lists.. each index in the array represents the
> node number and the linked list of that represents edges of that node.
--
You received this message because you are subscribed to the Google Groups
"Algorit
+1
On Fri, Mar 16, 2012 at 11:35 PM, shady wrote:
> i wanted to try the questions now, but can't submit, can you provide the
> problems, and testdata ?
>
>
> On Mon, Mar 12, 2012 at 10:41 PM, Kashyap Krishnakumar
> wrote:
>>
>> Hi,
>> The online programming contest of ITRIX, the national lev
with equal probability
On Tue, Feb 28, 2012 at 5:28 AM, Prakash D wrote:
> i've another doubt. what to do when I need to generate a random long long?
>
> On Mon, Feb 27, 2012 at 9:07 PM, Don wrote:
>> For instance, if RANDMAX= 32768, then
>>
>> x = rand() % 20
i've another doubt. what to do when I need to generate a random long long?
On Mon, Feb 27, 2012 at 9:07 PM, Don wrote:
> For instance, if RANDMAX= 32768, then
>
> x = rand() % 2;
>
> is twice as likely to result in the value 10,000 as the value 15,000.
> This is because there are two output v
1) Your algorithm must be efficient
2) Your I/O should be fast enough. Use scanf, printf instead of
cin,cout in C++. Use BufferedReader instead of Scanner in case of
Java.
3) Ask such doubts in the space provided in the contest.
On Thu, Jan 26, 2012 at 11:17 PM, prakash y wrote:
> Please don't mi
why can't u simply place it as 1 2 3 4 5 6 7 1 2 3 4 5 6 7?
On Thu, Jan 19, 2012 at 2:05 AM, NEERAJ KODDHAN wrote:
> int[] a = new int[2*n];
> put(a, n);
>
> static void put(int[] a,int i){
> if(i>0){
> for(int j=0;j if(a[j]==0 && a[j+i+1]==0){
> a[j]=i;
> a[j+i+1]=i;
> put(a, i-1);
> a[j]=0;
ignore my last comment.. misunderstood
On Thu, Jan 19, 2012 at 1:04 PM, Prakash D wrote:
> why can't u simply place it as 1 2 3 4 5 6 7 1 2 3 4 5 6 7?
>
>
> On Thu, Jan 19, 2012 at 2:05 AM, NEERAJ KODDHAN wrote:
>
>> int[] a = new int[2*n];
>> put(a, n);
>
0-1 knapsack!
On Tue, Jan 3, 2012 at 5:14 PM, saurabh singh wrote:
> Most probably noThis is the subset sum problem which is proven NP
> complete...Even if a better solution than n^2 exists it won't work for all
> cases
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
only the number of comparisons is log(n)
On Mon, Dec 12, 2011 at 11:04 PM, Ankur Garg wrote:
> Agree with dave..Its still O(n)
>
>
> On Mon, Dec 12, 2011 at 10:57 PM, Dave wrote:
>
>> @Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first
>> round, involving n/2 comparisons, is O(n).
how those generators will generate? any idea?
On Tue, Dec 6, 2011 at 2:14 AM, Don wrote:
> The "rand" function is implementation defined, so it doesn't work the
> same for every compiler. Most of them use a pseudo-random generating
> function such as linear congruential generators, lagged Fibon
any constraints for path?
On Mon, Oct 31, 2011 at 11:19 AM, Ankuj Gupta wrote:
> Print all path of the tree that sums up to the given value. The path
> may start from any node.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post
if all possible diagonal movements are allowed i guess we must check all
the possibilities
On Mon, Oct 31, 2011 at 12:52 AM, mohit verma wrote:
> Given a matrix you have to find the shortest path from one point to
> another within the matrix. The cost of path is all the matrix entries on
> the w
@Piyush kapoor: i don't get it.. could u plz explain a lil more?
On Mon, Oct 24, 2011 at 8:19 PM, praveen raj wrote:
> for 3 set .. set value stored in array a[3] and p is the sum
>
> for( i=0;i<=a[0];i++)
> {
>for(j=0;j<=a[1];j++)
> {
> for(k=a[2];k>=0;k--)
> {
>
+1
On Mon, Oct 3, 2011 at 6:40 PM, ~*~VICKY~*~ wrote:
> @Shauib: cool soln. Thank you.
>
>
> On Mon, Oct 3, 2011 at 6:14 PM, Shuaib wrote:
>
>> Chk is a macro that gets replaced with an if statement. The else part gets
>> attached to the most recent if which is the one from the macro. And since
if the string is like abcdef
then they will be numbered like 012345 and now we represent them in base 5
numbering and also in sorted order
the next permutation is
012354
012435
012453
012534
012543
013245
and so on..
On Sat, Oct 1, 2011 at 4:11 PM, rahul sharma wrote:
> guys plz xplain logic be
congrats brother!!
On Thu, Sep 22, 2011 at 6:42 PM, saurabh wrote:
> thanx to all
>
> I have shared my interview experience at
> http://msidcinterview.blogspot.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this gro
no.. each ans[s] is stored before returning.. so there is no recalculation
of any substring
On Sun, Sep 18, 2011 at 4:12 AM, Marcelo Amorim Menegali <
mmeneg...@gmail.com> wrote:
> *ans[s]=find(s+1,len-1);*
>> if(s[0]<'3'&&s[1]<'7')
>> *ans[s] = ans[s]+find(s+2,len-2);*
>
>
in c/c++
without main function how to write a compilable code?
for example printing a string
On Tue, Sep 20, 2011 at 12:15 AM, hary rathor wrote:
> use #pragma in c .
> static block in java .
>
> by the way which lang you are talking about ?
>
> --
> You received this message because you are sub
A[i]<<3*i
why is it needed to convert from base 8 to base 10??
On Sun, Aug 21, 2011 at 4:07 PM, Sanjay Rajpal wrote:
> Hi your intention was logical OR or BITWISE OR ?
>
> u did Logical.
> Sanju
> :)
>
>
>
> On Sun, Aug 21, 2011 at 3:30 AM, sarvesh saran > wrote:
>
>> Hi Nitin,
>>
>> thanks th
:P.. no comments when i saw
On Sun, Aug 21, 2011 at 4:07 PM, sagar pareek wrote:
> @prakash
> before posting u should check what others already posted :D :D
>
> On Sun, Aug 21, 2011 at 4:03 PM, Prakash D wrote:
>
>> FUNC2(8)
>>
>> ==> 8==0? 1: 8 * FUNC1
got it
8==0? 1: 8*( 8 -1* 8-1-1)
==> 8*( 8 - {1* 8-1-1})
==> 8 * (8-6)
==> 16
but why???
On Sun, Aug 21, 2011 at 4:03 PM, Prakash D wrote:
> ==> 8==0? 1: 8*( 8-1* 8-1-1)
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks&quo
FUNC2(8)
==> 8==0? 1: 8 * FUNC1(8-1)
==> 8==0? 1: 8*( 8-1* 8-1-1)
==> 8 * (8-8-2)
==> -16
but why 16??
On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra wrote:
> #include
> #define FUNC1(i) (i*(i-1))
> #define FUNC2(i) (i==0?1:i*FUNC1(i-1))
> main()
> {
> int i=8;
>
>
> printf("\
dont ever use turboc
On Sat, Aug 20, 2011 at 11:36 PM, Saikat Debnath wrote:
> Placement questions are not compiler dependent... :P
>
>
> On Sat, Aug 20, 2011 at 11:32 PM, Abhishek
> wrote:
>
>> okay..
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Alg
hey, thanks..
but if it needs many iteration, then we've to check each time whether the
array is sorted.. is there any better way for swapping
On Thu, Aug 18, 2011 at 5:02 AM, Brijesh Upadhyay <
brijeshupadhyay...@gmail.com> wrote:
> IT is the question..
> You are given an N x N matrix with 0 and
any1??
On Sun, Aug 7, 2011 at 7:16 PM, Prakash D wrote:
> yeah, i also need to know the approach for this kind of problems asked in
> many places
>
>
> On Sun, Aug 7, 2011 at 3:58 PM, arvind kumar wrote:
>
>> Hi
>> Can any1 pls help me in solving this?
>> T
given the sum and product of n numbers we have to find those numbers(any one
possibility)
sum, product and n are inputs...
for example if the sum is 10, product is 36 and n is 3
then 3,3,4 is a possible solution...
if it is impossible we should print NO
i wrote this code.. is there any faster
@rashmi: there is no confusion for the third item.. so simply u buy all the
third item without any offer
On Mon, Aug 15, 2011 at 12:52 AM, ritu wrote:
> solution is as following if problem is "buy all the n items for
> minimum price if there are offers so that item j is free if customer
> buys K
no one to help ??
On Sat, Aug 13, 2011 at 10:48 PM, Prakash D wrote:
> k lets assume that there are 10 kinds of item in the shop
> price[]={10,20,30,40,50,60,70,80,90,100}
> quantity[]={5,5,5,5,5,5,5,5,5,5}
>
> say no.of items having some free discounts : 5
>
> say p,q,r
k lets assume that there are 10 kinds of item in the shop
price[]={10,20,30,40,50,60,70,80,90,100}
quantity[]={5,5,5,5,5,5,5,5,5,5}
say no.of items having some free discounts : 5
say p,q,r denotes buying q nos. of p we will get one r for free.. let them
be
5 4 1
2 5 1
8 2 10
9 1 10
1 5 10
expl
i dont think we can set precision during scanf
On Sat, Aug 13, 2011 at 9:49 PM, Anika Jain wrote:
> @gaurav: nyc one ;) how u made this one well?
>
> On Sat, Aug 13, 2011 at 6:14 PM, SANDEEP CHUGH wrote:
>
>> lol
>>
>>
>> On Sat, Aug 13, 2011 at 6:12 PM, Gaurav Menghani <
>> gaurav.mengh...@gmai
anyone?
On Fri, Aug 12, 2011 at 3:49 AM, cegprakash wrote:
> there are n number of items available in the shop
> price[] {size n} gives the cost of each item
> and there are quantity[] {size n} means that there are quantity[i]
> number of i'th item
>
> the shop keeper provides some free items
>
how does the above code work?
On Fri, Aug 12, 2011 at 1:14 PM, Rahul wrote:
> I understand. where I find some more tricks like these , I mean I
> really. find. bit thinking hacks. difficult to understand.
>
>
> On 8/12/11, Tarun Arya wrote:
> > RAHUL@
> > d question was to reverse d 2 numbers.
www.projecteuler.net
On Fri, Aug 12, 2011 at 6:52 AM, Dipankar Patro wrote:
> Topcoder will be a good option.
>
> Amazon mainly makes you write functions in which the parameters and
> structure of any user defined data types are clearly mentioned.
> Just coding on a normal computer will also hel
@anuj kumar: try this
#include
#include
int main()
{
int a=10,b=20;
char x=1,y=0;
printf("%d\n",a,b,x,y);
printf("%d\n",(a,b,x,y));
if(a,b,x,y)
{
printf("EXAM");
}
getchar();
}
this will print 10 and 0
because if the outer bracket is not there, onl
could anyone explain the question 4?
On Fri, Aug 12, 2011 at 3:23 AM, Prakash D wrote:
> for 3 i think only b is the true statement
>
>
> On Fri, Aug 12, 2011 at 3:20 AM, Prakash D wrote:
>
>> whats the solution for 3?
>>
>>
>> On Tue, Aug 9,
for 3 i think only b is the true statement
On Fri, Aug 12, 2011 at 3:20 AM, Prakash D wrote:
> whats the solution for 3?
>
>
> On Tue, Aug 9, 2011 at 6:13 PM, Akash Mukherjee wrote:
>
>> @srinivas if any of the characters (i,n,d,a) appear den it is no longer
>> read
whats the solution for 3?
On Tue, Aug 9, 2011 at 6:13 PM, Akash Mukherjee wrote:
> @srinivas if any of the characters (i,n,d,a) appear den it is no longer
> readso gujr
>
>
> On Tue, Aug 9, 2011 at 6:04 PM, Srinivas Varanasi
> wrote:
>
>> Can any one explain question number 8?
>>
>>
>> On T
sorry that was for equal case : for unequal case 1-(73/648)= 575/648
On Fri, Aug 12, 2011 at 2:28 AM, Prakash D wrote:
> total possible outcomes= 6*6*6*6
>
> possibility of sum gives 2 in both pair --> 1*1*1*1 =1
> possibility of sum gives 3 in both pair --> 2*1*2*1
total possible outcomes= 6*6*6*6
possibility of sum gives 2 in both pair --> 1*1*1*1 =1
possibility of sum gives 3 in both pair --> 2*1*2*1 =4
{because the possibilities are (1,2)(1,2), (1,2)(2,1), (2,1)(1,2),
(2,1)(2,1)}
possibility of 4 --> 9 { 2,2 1,3 and 3,1}
possibility of 5 --> 16 {1,4 2,3
@sagar nice one :D
what u specified above is the scenario in gcc and dev c++ right?
On Fri, Aug 12, 2011 at 1:55 AM, sagar pareek wrote:
> : :))
>
>
> On Fri, Aug 12, 2011 at 1:54 AM, aditi garg wrote:
>
>> @sagar.: Now i get it:)
>> Thanks a ton :)
>>
>> On Fri, Aug 12, 2011 at 1:51 AM, sagar
+1.. it'll be helpful
On Thu, Aug 11, 2011 at 12:12 AM, Prashant Gupta
wrote:
> +1 to deepika.
>
>
> On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand wrote:
>
>> can anyone please post the questions asked in goldman sachs this year
>>
>> --
>> You received this message because you are subscribed to
i think the given formula's solution should be
c1 h33 o20 n10
check the question..
On Wed, Aug 10, 2011 at 9:49 PM, vikas wrote:
> Write a program to find the empirical formulae from physical formulae
> ex: ch3((oh)2(nh3)2)5
> has empirical formulae
> c1 h43 o2 n10
>
> --
> You received this
is there anything like there should be atleast one man and one women should
dance together?
On Wed, Aug 10, 2011 at 2:26 AM, Shuaib Khan wrote:
>
>
> On Wed, Aug 10, 2011 at 1:45 AM, Brijesh Upadhyay <
> brijeshupadhyay...@gmail.com> wrote:
>
>> No thers is not.. someone has asked me this., don
@dave: thank you.. nice explanation :)
On Wed, Aug 10, 2011 at 3:24 AM, Dave wrote:
> @Ritu: We are flipping one coin five times. Are you saying that you
> don't learn anything about the coin by flipping it? Would you learn
> something if any one of the five flips turned up tails? After a tails,
@rajkumar: thanks
#include
#define max(a,b) ((a>b)?a:b)
int main()
{
int m,n;
m=3+max(2,3);
n=2*max(3,2);
printf("%d,%d",m,n);
getchar();
return 0;
}
this gives the correct output as 6,6
On Mon, Aug 8, 2011 at 7:12 PM, Dipankar Patro wrote:
> relational operators give 0/1 outp
is there any constraint for anyone to dance?
--
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
algogeeks+unsubscr...@googlegroups.co
s. Should we multiply by 6! * 6! (1 6! for
> each side)??
>
> is the answer
> 12C6* 6c3 * 6C2 * 6! * 6!??
>
> On Tue, Aug 9, 2011 at 9:22 PM, Prakash D wrote:
>
>> the solution will be 12C6* 6c3 * 6C2
>>
>> because if you choose 6 people for the left side, t
cool.. i was lazy to look at your code :P
On Tue, Aug 9, 2011 at 9:32 PM, WgpShashank wrote:
> @CEG thats what i explained in given link dude isn't it :)
>
> @punnu & some others we need to find 3 Maxs & 2 Mins in 5 passes over array
> we can do it in single pass it self as explained in link time
the solution will be 12C6* 6c3 * 6C2
because if you choose 6 people for the left side, then there is no option
for the right side(i.e. we can select only the remaining 6 people for right
side)
also this 12C6 will provide all possible combinations for choosing 6 members
for left or right and there
if the initial array is [9, 2, 3, -4, 8, 5, 6, 10]
square all the elements in the array O(n)
map all the squares and set as 1 if it is present in array O(n)
sort the array.. O(n log n)
i=0 to n-1
j=i+1 to n-1
if(map(arr[i]+arr[j])) then there exist a triplet
O(nlog n)
so totally this algo
12C6* 6c3 * 6C2
On Tue, Aug 9, 2011 at 2:10 PM, programming love <
love.for.programm...@gmail.com> wrote:
> members
--
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 unsubscr
yeah, yours is enough :) tried with various combinations.. thanks
On Tue, Aug 9, 2011 at 2:20 AM, Dave wrote:
> @Prakash: Yeah, but doesn't the max take care of that?
>
> Dave
>
> On Aug 8, 3:07 pm, Prakash D wrote:
> > yeah.. but the smaller numbers must be negative
so you should use absolute values in second part
On Tue, Aug 9, 2011 at 2:20 AM, Dave wrote:
> @Prakash: Yeah, but doesn't the max take care of that?
>
> Dave
>
> On Aug 8, 3:07 pm, Prakash D wrote:
> > yeah.. but the smaller numbers must be negative in first pa
yeah.. but the smaller numbers must be negative in first part and largest
numbers should be of same signs in second part
On Mon, Aug 8, 2011 at 6:24 PM, Dave wrote:
> max(product of two smallest numbers and largest number, product of
> three largest numbers).
>
--
You received this message be
for 5th one loop will terminate only when n=0 which is not possible i think
On Mon, Aug 8, 2011 at 10:58 PM, D!leep Gupta wrote:
> yup 1st ans is b.
>
>
> On Sat, Aug 6, 2011 at 10:12 PM, sukran dhawan wrote:
>
>> i think 1st one is b.not sure. can anybody correct me?
>>
>>
>>
>> --
>> You rece
how 2,3 any idea??
On Mon, Aug 8, 2011 at 5:09 PM, raj kumar wrote:
> I think you forgot to give a space between macro and it's expansion that's
> why
> max(a,b)(a>b)?a:b
> is getting expanded to null
> and the above result
>
> --
> You received this message because you are subscribed to the Go
@gaurav: are u sure?
On Mon, Aug 8, 2011 at 3:40 PM, Amir wrote:
> Both Will take same time.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/
simple soln = max( product of lowest two negative numbers and highest
positive number, product of highest three negative numbers, product of
highest three positive numbers)
On Mon, Aug 8, 2011 at 4:50 PM, Aditya Virmani wrote:
> what if we can maintain three arrays:
> large_positives[3]: contain
us tosses and dependent only on
>>>> coin selection...!
>>>>
>>>> 1/5 + 4/5(1/2)= 3/5
>>>>
>>>> is the correct answer
>>>>
>>>> we want to calc. probability of getting heads the sixth time only
>>>>
@ all: am sorry.. i din't saw the word "same packet".. so the prob of
choosing a blue from 2nd possibility is 0 and so totally there are 1/2
possibilities
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to al
gt; On Sun, Aug 7, 2011 at 9:14 PM, Prakash D wrote:
>
>> The solution is 5/6 for sure
>>
>>
>> the possible outcomes after a blue is chosen are
>>
>> blue 1 1 0
>> black 0 1 2
>>
>> and
>>
>> blue 2 0 0
>> black 0 1
1.) coin is fair
2.) coin is unfair
P(head) for unfair coin= 1/5 * 1= 1/5
P(head) for fair coin= 4/5* 1/2 = 2/5
the probability at any instant that the tossed coin is a head is 3/5
17/80 is the probability to get head at all the six times.
the soln. for this problem will be 3/5
On Mon, Aug 8,
counting sort with hashing
On Sun, Aug 7, 2011 at 10:23 AM, rahul rai wrote:
> Thats True , Even insertion and merge sorts are too ..
>
> !!!
>
>
> Rahul
>
>
> On Sun, Aug 7, 2011 at 10:20 AM, Gaurav Menghani <
> gaurav.mengh...@gmail.com> wrote:
>
>> "The Postman's sort is a variant of bucket s
is there a faster algo than O(n^2)?
On Sun, Aug 7, 2011 at 4:14 PM, raj kumar wrote:
> similar to make change dp problem
>
> --
> 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.co
The solution is 5/6 for sure
the possible outcomes after a blue is chosen are
blue 1 1 0
black 0 1 2
and
blue 2 0 0
black 0 1 2
prob of choosing a blue from 1st possibility = 1/3+1/6
prob of choosing a blue from 2nd possibility= 1/3
so totally there are 5/6 possibilities
On Sun, Au
any idea for 5th one?
On Sun, Aug 7, 2011 at 7:50 PM, Prakash D wrote:
> @siddharam: for the second one, the series is like this
>
> the first character will print once.
> second one twice
> third one four times and so on
>
> 1,2,4,8,...
>
> On Sun, Aug 7, 2011 at 4:5
@siddharam: for the second one, the series is like this
the first character will print once.
second one twice
third one four times and so on
1,2,4,8,...
On Sun, Aug 7, 2011 at 4:53 PM, Dave wrote:
> 6.5 = 2^2 + 2^1 + 2^-1
> Binary representation = 110.1 = 1.101 * 2^2.
>
> 0.1 = 2^-3 + 2^-4 + 2
yeah, i also need to know the approach for this kind of problems asked in
many places
On Sun, Aug 7, 2011 at 3:58 PM, arvind kumar wrote:
> Hi
> Can any1 pls help me in solving this?
> Two persons are running on a circular track either in the same
> direction or in the opposite direction, indefi
, Aug 7, 2011 at 7:04 PM, Prakash D wrote:
>
>> that won't work.. there may be two negative bigger numbers whose product
>> will bcom +ve
>>
>>
>> On Sun, Aug 7, 2011 at 6:49 PM, Puneet Ginoria
>> wrote:
>>
>>> find the first three larg
that won't work.. there may be two negative bigger numbers whose product
will bcom +ve
On Sun, Aug 7, 2011 at 6:49 PM, Puneet Ginoria wrote:
> find the first three largest nos. and 3 smallest number(negatives).. then
> easily you can fig. out the solution..
>
> O(6n) solution i guess which is O(n
O(1) space is t hard for this task
On Thu, Aug 4, 2011 at 12:55 AM, payel roy wrote:
> Is there any solution for the above?
>
>
> On 3 August 2011 21:09, coder coder wrote:
>
>> ya amazon will be visiting our campus within few days
>>
>> --
>> You received this message because you are sub
if it is an 2D array of pointers we can :)
On Wed, Aug 3, 2011 at 11:32 PM, shiv narayan wrote:
> yes we can.
>
> On Aug 3, 10:08 pm, Arshad Alam wrote:
> > can we insert 16 elements of one dimension array in 4*4 of double
> dimension
> > array?
>
> --
> You received this message because you are
lol.. nice one :D
On Thu, Aug 4, 2011 at 12:30 AM, Don wrote:
>n = log(log(n));
>
--
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 ema
no.. it's really easy to find it out
there are 12 black and 12 white pieces.
let black =1 and white =0
the possible results are 11, 00, 10, 01
number of ways of 11 solutions= 12 * 11 = 132
number of ways of 00 solutions = 12 * 11 = 132
number of ways of 10 solutions = 12 * 12 = 144
number o
@Gene: nice one :D
On Wed, Aug 3, 2011 at 11:02 PM, sagar pareek wrote:
> same questions...not a single diff were asked in NIT allahabad on 17 july
> this yr...
>
>
> On Wed, Aug 3, 2011 at 8:21 PM, Vengadanathan wrote:
>
>> It may not work for all , the parameter input is double what happens
>>
i din't look at the word pair :P.. sorry
--
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
algogeeks+unsubscr...@googlegroups.com.
F
18/33?
On Wed, Aug 3, 2011 at 10:42 PM, muthu raj wrote:
> 5)
> Sample space=24C2= 276
> N(S) = 12 C 2 + 12 C 2 =132
>
> Probability= 132/276= 11/23
>
>
> *Muthuraj R
> IV th Year , ISE
> PESIT , Bangalore*
>
>
>
> On Wed, Aug 3, 2011 at 10:36 PM, Pra
assume there are 6 1's and 6 0's
if two are selected together randomly
the possible outcomes are 00, 11, 01, 10
00- 30 possibilities
11 - 30 possibilities
10 - 36 possibilities
01 - 36 possibilities
probability of 10 or 01 = (36+36)/(30+30+36+36)
=18/31
is it one of the options?
On Wed,
I dont get this part of your proof.. :(.
"Y-X is a fraction so it's not valid assumption."
On Wed, Aug 3, 2011 at 9:57 PM, D!leep Gupta wrote:
> Y-X is a fraction so it's not valid assumption.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group
yeah.. it's 15!
On Mon, Aug 1, 2011 at 1:24 PM, coder dumca wrote:
> i think the answer should be 15
>
>
> On Mon, Aug 1, 2011 at 12:46 PM, Abhishek Gupta wrote:
>
>> let the array be A={ 3,5,7,10} then it should give output as 13 (3+10)
>>
>> In short, we need to find the possible maximum sum s
someone post all the questions asked by amazon pls.. it'll be useful
On Wed, Aug 3, 2011 at 3:43 PM, Arun Vishwanathan wrote:
> it cud also be 0011
>
>
> On Wed, Aug 3, 2011 at 6:54 AM, payel roy wrote:
>
>> It is contiguous ...the answer will be 0110.
>>
>>
>> On 2 August 2011 20:59, ankit samb
I just thought of an O(n) dp solution
let a[]=5,2,1,7,9,11
traverse from i=0 to n-1
we define arr[i]= a[i]+max(arr[i-2],arr[i-3));
first arr[0]= 5 + max( a[-2], a[-3]) = 5
arr[1]= 2
arr[2]=1 + 5
arr[3]= 7 + max(5,2) = 7+ 5 = 12
then arr[4]= 9 + max(2,6) = 15
then arr[5]= 11 + max(6,12) =
you cannot choose 7 and 10 since they are adjacent
On Mon, Aug 1, 2011 at 1:17 PM, Prakash D wrote:
> i can write a O(n^2) soln. but i hope there could be a better way
>
>
> On Mon, Aug 1, 2011 at 12:46 PM, Abhishek Gupta wrote:
>
>> let the array be A={ 3,5,7,10} then it
i can write a O(n^2) soln. but i hope there could be a better way
On Mon, Aug 1, 2011 at 12:46 PM, Abhishek Gupta wrote:
> let the array be A={ 3,5,7,10} then it should give output as 13 (3+10)
>
> In short, we need to find the possible maximum sum such that no 2 elements
> in the subarray has 2
@priyanka : thank you
On Sun, Jul 31, 2011 at 3:17 PM, saurabh singh wrote:
> yup you are right.prakash try some cases and you will get why its
> necessary.
> (Yup i agree can be written in an if else way but i like it this way
> better)
>
>
> On Sun, Jul 31, 2011 at 2:08 PM, priyanka raju wrote
what does n mod 2's job here?
the only possible return case is when n/2 is 0 or 1
On Sat, Jul 30, 2011 at 2:04 PM, saurabh singh wrote:
> And yes the formula is derived by the fact that x^(a+b)=x^a*x^b
> and then think top down with respect to a general variable n.(That is how
> to split n in
* 2 3 5 6
On Mon, Jul 25, 2011 at 6:38 PM, Prakash D wrote:
> thank you all for the gcd algo
>
> 1) is the solution is 2 3 5 2 ?
>
> 2) it will not work for double values which is beyond integer range!!
>
>
> 3) this will find the number of 1's in binary re
thank you all for the gcd algo
1) is the solution is 2 3 5 2 ?
2) it will not work for double values which is beyond integer range!!
3) this will find the number of 1's in binary representation of x^y..
right?
someone explain the CFG question plz..
On Sat, Jul 23, 2011 at 5:58 PM, arun kum
post the 10 questions plz
On Fri, Jul 22, 2011 at 8:29 PM, shady wrote:
> what was it ? job interview questions or intern ?
>
> gcd can always be found in O(log(larger number)) , sorry, couldnt
> understand the complexity in that ?
>
>
> On Fri, Jul 22, 2011 at 8:22 PM, siva viknesh wrote:
>
>>
could someone explain the algo with an example?
On Sun, May 22, 2011 at 8:21 PM, Puneet Ginoria wrote:
> thnxx all.. i got the soln..
> Qdumanshu: i was asking for quotient and remainder when we divide 2 nos.
> without actually dividing them...
>
>
>>
> --
> You received this message because you
@charles: think in his point of view.. everyone's needs are different
On Mon, May 9, 2011 at 4:26 AM, Charles Turner wrote:
> On 08/05/2011 23:32, ankit sablok wrote:
>
> Please mail the book "Data Structures and Algorithms in C" by Mark
> Allen Weiss to the following Id - ankit4...@gmail.com
>
mail me too plzz.. cegprak...@gmail.com
On Sun, May 8, 2011 at 10:00 PM, UTKARSH SRIVASTAV
wrote:
> mail me also usrivastav...@gmail.com
>
>
> On Sun, May 8, 2011 at 1:08 AM, ArPiT BhAtNaGaR <
> arpitbhatnagarm...@gmail.com> wrote:
>
>> dere is soln first person mail to first person on list n d
sorry, i misunderstood the problem statement
On Sun, May 8, 2011 at 10:53 AM, Aakash Johari wrote:
> @cegprakash: it doesnt ensure that both the arrays will be having same
> number of elements
>
>
> On Sat, May 7, 2011 at 10:10 PM, cegprakash wrote:
>
>> simple..
>>
>> sum all the n elements
nice explanation
--
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
algogeeks+unsubscr...@googlegroups.com.
For more options, visit t
is there any use with labels xxx, yyy.. ?
--
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
algogeeks+unsubscr...@googlegroups.com.
97 matches
Mail list logo