@nitin Plz explain how u have reached answer of question no. 4 and 6
On 19-Sep-2011 12:26 AM, Nitin Garg nitin.garg.i...@gmail.com wrote:
Answer 3 - 100
Answer 6 - 103
Answer 4 - 194 total processes including the parent
Answer 7 - 12 km south, 12 km east
On Sun, Sep 18, 2011 at 11:53 PM,
@Nitin: Answer to question 3 is 50.
On Mon, Sep 19, 2011 at 11:44 AM, praveen raj praveen0...@gmail.com wrote:
@nitin Plz explain how u have reached answer of question no. 4 and 6
On 19-Sep-2011 12:26 AM, Nitin Garg nitin.garg.i...@gmail.com wrote:
Answer 3 - 100
Answer 6 - 103
Guys does any one have idea about MAQ's written recruitment
interview process plzz let me know..
Wat are the possible questions that come in written and interview plzz
post dem?
thx in advance
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
on running,every time i get second a=30... any reasons for that???
--
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
Question 3 -
To eliminate one player, you need to host atleast 2 matches and make him
loose in both 2. These 2 matches can not contribute to elimination of any
other player.
So, min 2 matches for every player who is to be eliminated, hence 100.
On Mon, Sep 19, 2011 at 11:54 AM, Bhanu Chowdary
common guys its undefined acc to standard c
On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee
thefourrup...@gmail.com wrote:
on running,every time i get second a=30... any reasons for that???
--
You received this message because you are subscribed to the Google Groups
Question 6 -
Intuitively you can see that the greater the sum is, the greater the
favorable events in sample space.
e.g. - sum = 1 .. cases {(1)} Pr = 1/6
sum = 2 cases {(2),(1,1)} Pr = 1/6 + 1/36
sum = 3cases {(3),(2,1)(1,2)(1,1,1)} Pr = 1/6 + 1/36 +1/36 +
1/216
In Question 4 i just kept counting new processes that are being added in
every iteration.
No. of new processes being created is equal to the already running no. of
even pid processes.
Time - PId
0 - 0 1
1 - 0,12
2, - 0,1,23
3,
Can someone tell answers to question 2 and 5 with explanation??
On Mon, Sep 19, 2011 at 1:40 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:
In Question 4 i just kept counting new processes that are being added in
every iteration.
No. of new processes being created is equal to the already
@VIHARRI
i think q.5 is *Which is not thread safe ??* :D :D
On Mon, Sep 19, 2011 at 1:43 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:
Can someone tell answers to question 2 and 5 with explanation??
On Mon, Sep 19, 2011 at 1:40 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:
In Question
For question 2 see ashima link.
On 19-Sep-2011 1:43 PM, Nitin Garg nitin.garg.i...@gmail.com wrote:
Can someone tell answers to question 2 and 5 with explanation??
On Mon, Sep 19, 2011 at 1:40 PM, Nitin Garg nitin.garg.i...@gmail.com
wrote:
In Question 4 i just kept counting new processes
@Nithin: Sorry I did not understand your logic!! If a person looses a match
he should be knocked out of the tournament. Could you please explain why 2
matches to knock out a person??
On Mon, Sep 19, 2011 at 2:47 PM, praveen raj praveen0...@gmail.com wrote:
For question 2 see ashima link.
On
Given in the question
.
On 19-Sep-2011 2:57 PM, Bhanu Chowdary bhanuchowd...@gmail.com wrote:
@Nithin: Sorry I did not understand your logic!! If a person looses a
match
he should be knocked out of the tournament. Could you please explain why 2
matches to knock out a person??
On Mon, Sep 19,
For question 5 reentrant
On 19-Sep-2011 1:43 PM, Nitin Garg nitin.garg.i...@gmail.com wrote:
Can someone tell answers to question 2 and 5 with explanation??
On Mon, Sep 19, 2011 at 1:40 PM, Nitin Garg nitin.garg.i...@gmail.com
wrote:
In Question 4 i just kept counting new processes
Can any one have any idea how this make file is working.
Without compiling gcc -c p1.c.
***
exe : p1.o
gcc -o exe p1.o
p1.o : p1.c
clean:
rm *.o
rm exe
***
Makefile output as follows :
cc-c -o p1.o p1.c // I
5 ans-C
reference http://en.wikipedia.org/wiki/Reentrant_(subroutine)
On Sat, Sep 17, 2011 at 9:11 AM, VIHARRI viharri@gmail.com wrote:
1. Minimum no.of comparisons required to select the 2nd max element in
an array of N numbers.
2. What are the number of counting ties for four horses.
@piyush: what is time and space complexity of u'r sol..
On Mon, Sep 19, 2011 at 11:03 AM, Piyush Grover
piyush4u.iit...@gmail.comwrote:
sry, in the findWord function all a's are different e.g
a0, a1a7
and if(!a) is actually if(a0||a1||...||a7)
thnx
piyush
On Mon, Sep 19, 2011 at
output is
18 9 0
0
0
8
the same was expected.
printf uses stack when it has multiple arguments to print
On Sep 18, 1:19 pm, Bhavesh agrawal agr.bhav...@gmail.com wrote:
another que..
#includestdio.h
main()
{
int a;
int i=10;
printf(%d %d %d\n,i+++i,i,i---i);
@ sukran
if it is giving same ans then there has to be some reason,
On Sep 19, 12:45 pm, sukran dhawan sukrandha...@gmail.com wrote:
common guys its undefined acc to standard c
On Mon, Sep 19, 2011 at 12:36 PM, Siddhartha Banerjee
thefourrup...@gmail.com wrote:
on
plz share .
On 8 September 2011 19:41, algo geek geeka...@gmail.com wrote:
--
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
According to K and R c book , when the return value is specified and yet we
fail to return a value, it is undefined. It is compiler dependent.
So i feel there is no meaning in thinking abt it
On Mon, Sep 19, 2011 at 4:38 PM, abhishek abhishek.ma...@gmail.com wrote:
@ sukran
if it is giving
Hello guys, i got an offer from inmobi and akamai. Which one to choose ?
--
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
Why do we pass a reference for copy constructors?
If it does shallow copy for pass by value (user defined object), how
will it do the deep copy?
Ans:- if we don't pass the reference, every time a new object copy
like
A a=b;
constructor will be called twice ,,
correct me if i'm wrong...
help
Yes u r saying correct .
On 19-Sep-2011 6:39 PM, teja bala pawanjalsa.t...@gmail.com wrote:
Why do we pass a reference for copy constructors?
If it does shallow copy for pass by value (user defined object), how
will it do the deep copy?
Ans:- if we don't pass the reference, every time a
i have explained :)
On Sun, Sep 18, 2011 at 11:53 PM, Ashima . ashima.b...@gmail.com wrote:
@malay: how cm n+logn-2?
cn u explain the logic ?
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan
On Sun, Sep 18, 2011 at 11:07 AM, Ashima . ashima.b...@gmail.com wrote:
@praveen
how about shallow copy and deep copy of copy constructor?
On Mon, Sep 19, 2011 at 6:53 PM, praveen raj praveen0...@gmail.com wrote:
Yes u r saying correct .
On 19-Sep-2011 6:39 PM, teja bala pawanjalsa.t...@gmail.com wrote:
Why do we pass a reference for copy constructors?
abhishek can you plz explain
--
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
A graph is given :
nodes denoting computers
edges denoting connections
if one system(node) fails , the other systems(node) may get affected.
To identify all the affected nodes, which data structure is used? How
do u implement it?
--
You received this message because you are subscribed to the
example ?
link to the actual problem ?
On Mon, Sep 19, 2011 at 7:44 PM, Sangeeta sangeeta15...@gmail.com wrote:
A graph is given :
nodes denoting computers
edges denoting connections
if one system(node) fails , the other systems(node) may get affected.
To identify all the affected nodes,
This depends on rnd being a good pseudo-random generator. I don't
suggest using the RNG built into many compilers. Instead use something
like the Mersenne Twister which produces much better results with an
extremely long period. My Random class has a gen method which
returns an integer in the
Does anyone can xplain Function object or functor in C++ with
example???
thx in advance.
--
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
I divide by 5 to determine how many ways there are to use nickles. I
could have written a for loop:
for(nickles = 0; (quarters+dimes+nickles) = n; nickles += 5)
++result;
But that would have just executed 1+(n-quarters-dimes)/5 times
incrementing result every time. I just computed the result
m getting result in 95 matches
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan
On Mon, Sep 19, 2011 at 7:07 PM, malay chakrabarti m1234...@gmail.comwrote:
i have explained :)
On Sun, Sep 18, 2011 at 11:53 PM, Ashima . ashima.b...@gmail.com wrote:
@malay: how cm
anyone give an algorithm of how to generate a random number..probability of
occurrence of each no should be the same..
--
*prasanth*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@Saurabh: Maybe after the line
p1.o : p1.c
you should insert the line
gcc -c p1.c
Without that, make uses the default rule for constructing a .o file
from a .c file.
Dave
On Sep 19, 4:58 am, Saurabh saurabh24...@gmail.com wrote:
Can any one have any idea how this make file is working.
Q9 - 1 *logn for getting the minimum element ..Normal heap Sort procedure
Q3 - n+logn-2 comparisions so 51 -2 + log 51
Regards
Ankur
On Mon, Sep 19, 2011 at 7:59 PM, Ashima . ashima.b...@gmail.com wrote:
m getting result in 95 matches
Ashima
M.Sc.(Tech)Information Systems
4th year
You mean a pseudo-random generator.
Without special hardware you won't get a real random generator.
Use Mersenne Twister.
Don
On Sep 19, 9:43 am, prasanth n nprasnt...@gmail.com wrote:
anyone give an algorithm of how to generate a random number..probability of
occurrence of each no should be
Hello guys, i got an offer from inmobi and akamai. Which one to choose ?
Guys please reply! Im in confusion
--
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
package plz for each?
On Mon, Sep 19, 2011 at 8:22 PM, ravinder s ravinderr...@gmail.com wrote:
Hello guys, i got an offer from inmobi and akamai. Which one to choose ?
Guys please reply! Im in confusion
--
You received this message because you are subscribed to the Google Groups
i=0;
char *str;
while(a[i]!=NULL)
{
j=0;
while(j!=i)
{
for(k=j;k=i;k++)
{
l=0;
str[l]=a[j];
}
if(Dictionary.findword(str))
printf(str);
j++;
}
}
...
On Mon, Sep 19, 2011 at 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote:
given
// there were some mistakes...
so...
i=0;
char *str;
while(a[i]!=NULL)
{
j=0;
while(j!=i)
{
l=0;
for(k=j;k=i;k++)
{
str[l]=a[j];
l++
}
if(Dictionary.findword(str))
printf(str);
j++;
}
}
On Mon, Sep 19, 2011 at 8:44 PM,
construct a trie.. then a simple recursion on the trie ll do ... :) any
standard tutorial on tries ll help u build one ...
then the recursion part should look something like this,
start scanning from root of tire.
if(end of word is found)
{
take is as a word, start searching from root of a
didnt read the question properly ... ignore ma post !! :/
On Mon, Sep 19, 2011 at 8:44 PM, Yogesh Yadav medu...@gmail.com wrote:
i=0;
char *str;
while(a[i]!=NULL)
{
j=0;
while(j!=i)
{
for(k=j;k=i;k++)
{
l=0;
str[l]=a[j];
}
for that u have rand() function in c programming just go through it
On Mon, Sep 19, 2011 at 8:42 PM, prasanth n nprasnt...@gmail.com wrote:
@don:
suppose if give like random(5)- it must give any number between 0 and 5..
On Mon, Sep 19, 2011 at 8:22 PM, Don dondod...@gmail.com wrote:
You
The most common way that it works would be that random(n) returns the
equivalent of a random integer mod n, so 0=xn. But there is no
standard for how they work, so know what you are dealing with.
Don
On Sep 19, 10:12 am, prasanth n nprasnt...@gmail.com wrote:
@don:
suppose if give like
The rand() functions built into many compilers are notoriously bad.
If the quality of the random series doesn't matter much, it might be
ok. If you are doing any kind of simulation, use Mersenne Twister.
Don
On Sep 19, 10:48 am, abhinav gupta abhinav@gmail.com wrote:
for that u have rand()
@teja:
if we use call by value in copy constructor,,
class base
{
int a;
public:
base(int x)
{
a=x;
}
base(base c)
{
}
};
int main()
{
base b(1);
base b1=b;// this ll be seen as base c=b(see the copy constructor)..this ll
in turn call another copy constructor..
return 0;
}
now it ll create
is it possible to print something without a main function??
I wonder how the code won't get any compile error
--
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
Use trie.
On 19-Sep-2011 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote:
given an array of characters without spaces and a dictionary.All valid
dictionary words must be found and printed.
i/p : BANKERKCATXYWOMAN.
o/p: BANK
BANKER
CAT
WOMAN
MAN
(the only function you could use for
Hi
Can anyone say me which is the best hashing tecnicque which can store
duplicates and minimize time complexity?
Pls reply
--
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.
Assuming that findword is O(n) for words of size n, this will be an
O(n^3) algorithm. If you had a better interface to the dictionary, it
could be O(n). That's another example of why interfaces should be
designed for the intended task.
Don
On Sep 19, 9:50 am, Sangeeta sangeeta15...@gmail.com
@don:
can u give the algorithm??
On Mon, Sep 19, 2011 at 10:37 PM, praveen raj praveen0...@gmail.com wrote:
Use trie.
On 19-Sep-2011 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote:
given an array of characters without spaces and a dictionary.All valid
dictionary words must be found and
trie data structure
On Mon, Sep 19, 2011 at 10:37 PM, praveen raj praveen0...@gmail.com wrote:
Use trie.
On 19-Sep-2011 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote:
given an array of characters without spaces and a dictionary.All valid
dictionary words must be found and printed.
i/p
package is 8.5 lakhs and 9 lakhs
On Mon, Sep 19, 2011 at 8:25 PM, malay chakrabarti m1234...@gmail.comwrote:
package plz for each?
On Mon, Sep 19, 2011 at 8:22 PM, ravinder s ravinderr...@gmail.comwrote:
Hello guys, i got an offer from inmobi and akamai. Which one to choose ?
Guys
as such there is no specific method to generate random number but if you
have to implement it then you can generate a pseudo random generator
using cur_time_value_in_mili_seconds mod n.
On Mon, Sep 19, 2011 at 9:24 PM, Don dondod...@gmail.com wrote:
The most common way that it works would be
does anybody know the fastest algo for prime factorization of a
number???
--
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
use #pragma in c .
static block in java .
by the way which lang you are talking about ?
--
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
how much big number are You tHINKING
Rahul
On Mon, Sep 19, 2011 at 2:40 PM, Manish Verma jalsa.n.sa...@gmail.com wrote:
does anybody know the fastest algo for prime factorization of a
number???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
around 999,999,999
or
the link to above pbm is
http://www.spoj.pl/problems/CZ_PROB2/
On Sep 19, 11:45 pm, Rahul raikra...@gmail.com wrote:
how much big number are You tHINKING
Rahul
On Mon, Sep 19, 2011 at 2:40 PM, Manish Verma jalsa.n.sa...@gmail.com wrote:
does anybody know the fastest
can anybody tell about other approach because suffix tree is very thought to
implement at interview or written test time
--
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
https://oli.web.cmu.edu/jcourse/workbook/activity/page?context=495037cd80020ca601966bbd4853030b
Rahul
https://oli.web.cmu.edu/jcourse/lms/students/syllabus.do?section=49502e3f80020ca60136d016a1574b4a
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
@Yogesh:fails for negative numbers..
(though I am also confused with the ques)
On Sep 19, 10:38 am, Yogesh Yadav medu...@gmail.com wrote:
current position is index n (say)
largest=0;
second_largest=0;
for(i=1;i=n;i++)
{
if(a[i]a[n])
{
if(a[i]largest)
{
second_largest=largest;
exactly.. to implement suffix tree was out f my reach atleast during
the test. even thou i knew dat it ws d correct DS to use. i cudn't
actlly use it.
On Sep 19, 11:51 pm, hary rathor harry.rat...@gmail.com wrote:
can anybody tell about other approach because suffix tree is very thought to
anshul +1 yes we have to assign some memory to the pointers
On Mon, Sep 12, 2011 at 1:19 PM, rahul vatsa vatsa.ra...@gmail.com wrote:
@Anshul +1
s,t r just pointers variables, and until u don't assign it addr of some
object, where will it keep the values for str elements which r being
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 harry.rat...@gmail.comwrote:
use #pragma in c .
static block in java .
by the way which lang you are talking about ?
--
You received this message
thanks siddharam,but i am form computers .I have given my interview.I
heard that C-dot asks questions from networking.But since networking
was not in our syllaybus i was too worried as i had only 2-3 hrs to
read about that .I took an idea about networking,but wasn't confident
that i will be
Yes...You cant use suffix trees here...Forget Coding...can anybody even
explain the algo as to how suffix trees or tries can be used here ?
On Tue, Sep 20, 2011 at 12:45 AM, pooja pooja27tan...@gmail.com wrote:
exactly.. to implement suffix tree was out f my reach atleast during
the test.
See this algorithm:
http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm
--
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,
nice find bhanu..though i didnt get much :P on first read :D :D
On Tue, Sep 20, 2011 at 4:34 AM, Bhanu Kishore bhanukishor...@gmail.comwrote:
See this algorithm:
http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm
--
You received this message because you are
@Dave printf(a=%x, b=%llx,a,b,c); i think c will be ignored~~ , and the
output is a=9,b=10
2011/9/19 Dave dave_and_da...@juno.com
@Wujin: What do you expect the output to be? How does it differ from
what you actually get?
Dave
On Sep 18, 8:47 am, wujin chen wujinchen...@gmail.com wrote:
@Utkarsh: In Yogesh's code assigning a[1] to largest and second_largest in
the beginning, -VE case will be handled.
On Mon, Sep 19, 2011 at 12:10 PM, asdqwe ayushgoel...@gmail.com wrote:
@Yogesh:fails for negative numbers..
(though I am also confused with the ques)
On Sep 19, 10:38 am,
@Wujin: Okay. But b is an integer and it is being printed as a long
long. Since there are no implicit type conversions in procedure calls
such as the printf statement, b is taken as a long long, not of an
int. So b and the next 32-bits are printed.
Dave
On Sep 19, 8:18 pm, wujin chen
@Wujin: Okay. b is but an integer, yet it is being printed as a long
long. Since there are no implicit type conversions in procedure calls
such as the printf statement, b is taken as a long long, not of an
int. So b and the next 32-bits are printed. The format that these are
printed in is a
@bharatkumar i think u r in thinking oder in lexicographic order .but in
question its not the same...
we have print the according to the sentence not according to dictonary
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
+1 to yogesh
--
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 this
// Could some body plzz xplain dis code..
#includestdio.h
void main()
{
long double lda=1e+37L,ldb=1e-37L;
long double a[2]={1234,5678};
long long unsigned int x=0x1234;
printf(%d %d %ld%ld %llx
%d,sizeof(lda),lda,a[0],a[1],x,sizeof(x));
}
--
You received this message
int i;
i=random(5);
int random(int x)
{
return (rand(x) % 5);
}
rand() is inbuilt function in c/c++;
On Mon, Sep 19, 2011 at 9:24 PM, Don dondod...@gmail.com wrote:
The most common way that it works would be that random(n) returns the
equivalent of a random integer mod n, so 0=xn. But
@Tammana can u pls give me the logic of the above code !
On Tue, Sep 20, 2011 at 8:35 AM, Tamanna Afroze afroze...@gmail.com wrote:
I don't know whether my one is good algorithm or not, but it gives somewhat
good output. It is in Java.
/*
* To change this template, choose Tools |
78 matches
Mail list logo