Typically what we need to do is a BFS.
But there are more advanced algorithms like Link prediction etc..
A recent paper on same topic might be an interesting read.
events.linkeddata.org/ldow2011/papers/ldow2011-paper08-dhekane.pdf
On Mar 22, 6:05 pm, snehal jain wrote:
> If you want to search f
*A Remainder is chasing me Problem Solution*
*
*I just found a number with an interesting property:
When I divide it by 2, the remainder is 1.
When I divide it by 3, the remainder is 2.
When I divide it by 4, the remainder is 3.
When I divide it by 5, the remainder is 4.
When I divide it by 6, the
2519
On Wed, Mar 23, 2011 at 1:11 PM, Lavesh Rawat wrote:
> *A Remainder is chasing me Problem Solution*
> *
> *I just found a number with an interesting property:
> When I divide it by 2, the remainder is 1.
> When I divide it by 3, the remainder is 2.
> When I divide it by 4, the remainder is 3
i found this good..
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor
On Mon, Mar 21, 2011 at 6:02 PM, Anurag atri wrote:
> yes , please suggest a nice tutorial for segment trees ..
>
>
> On Mon, Mar 21, 2011 at 5:48 PM, cegprakash wrote:
>
>> hey i want to learn seg
but..i read this oly after my senior taught me segment trees..
On Wed, Mar 23, 2011 at 4:43 PM, bharath kannan wrote:
> i found this good..
>
> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor
>
>
>
> On Mon, Mar 21, 2011 at 6:02 PM, Anurag atri wrote:
>
>> yes , plea
Hello everyone,
Im unable to understand the NUMGUESS problem in SPOJ.Can some one
explain what the problem is about?
Thanks in advance.
-Vishnutej.Mylavarapu
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email
in the topcoder tutorial of the segment trees, the value of the M[node]
should be modified during query, we only need to return it. Just a
correction, people have mentioned it in forum also.
On Wed, Mar 23, 2011 at 4:46 PM, bharath kannan wrote:
> but..i read this oly after my senior taught me se
oops, i mean it shouldn't be modified.
On Wed, Mar 23, 2011 at 6:56 PM, Arpit Sood wrote:
> in the topcoder tutorial of the segment trees, the value of the M[node]
> should be modified during query, we only need to return it. Just a
> correction, people have mentioned it in forum also.
>
>
> On
It is LCM(2,3,4,5,6,7,8,9,10) - 1 = 2^3 * 3^2 * 5 * 7 - 1 = 2519.
LCM = least common multiple.
Dave
On Mar 23, 2:41 am, Lavesh Rawat wrote:
> *A Remainder is chasing me Problem Solution*
> *
> *I just found a number with an interesting property:
> When I divide it by 2, the remainder is 1.
> Wh
I guess you solve it using binary search..
On Wed, Mar 23, 2011 at 6:48 PM, Vishnutej
wrote:
> Hello everyone,
>
> Im unable to understand the NUMGUESS problem in SPOJ.Can some one
> explain what the problem is about?
>
> Thanks in advance.
>
> -Vishnutej.Mylavarapu
>
> --
> You received this mes
Yup...Its a binary search problem,Check wiki page of binary search for the
same problem
On Wed, Mar 23, 2011 at 8:14 PM, bharath kannan wrote:
> I guess you solve it using binary search..
>
>
> On Wed, Mar 23, 2011 at 6:48 PM, Vishnutej > wrote:
>
>> Hello everyone,
>>
>> Im unable to understand
I may be wrong but if no==1000 then it becomes a[100] which is
beyond your array limit
On Mar 18, 12:31 am, KK wrote:
> i m getting TLE for this soln and m not getting the concept used in
> the above soln can anyone help??
> #include
> using namespace std;
> int main()
> {
> int t,n,k
i=9;
switch(i){
default: printf("default");
case '1': printf("one"); break;
case '2': printf("two"); break;
case '9': printf("nine"); break;
}
--
You received this message because you are subscribed to the Google Groups
"Algo
i=9;
switch(i){
default: printf("default");
case '1': printf("one"); break;
case '2': printf("two"); break;
case '9': printf("nine"); break;
}
why do i get "defaultone" as the output?
--
You received this message because you a
place break after default or place the default statement in the end...
On Wed, Mar 23, 2011 at 8:23 PM, cegprakash wrote:
> i=9;
>switch(i){
> default: printf("default");
> case '1': printf("one"); break;
> case '2': printf("two"); break;
>
why do i get "one" after "default"?
--
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 mo
since u havnt written da break statement...the case '1' also gets
executed..and then when the break statement is encountered..the control
comes out of the switch case
On Wed, Mar 23, 2011 at 8:27 PM, cegprakash wrote:
> why do i get "one" after "default"?
>
> --
> You received this message beca
bcoz '9'!=9.Anything within ' '(single quotes) is a character and not
int
On Wed, Mar 23, 2011 at 8:27 PM, cegprakash wrote:
> why do i get "one" after "default"?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this g
i is not equal to '1'
i=1 which is equialent to 49
--
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...@googlegro
sorry i meant '1'=49
and 9 is not 49
but how we get "one"
--
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...@go
ryt..since none of the cases match so default case is executed,..but since u
havnt placed break aftr dat..case '1' too gets executed..evn if u didnt
intend to do so..dats y da output "defaultone"
On Wed, Mar 23, 2011 at 8:31 PM, cegprakash wrote:
> i is not equal to '1'
> i=1 which is equialent
i=9;
switch(i){
default: printf("default");
case 9: printf("one"); break;
case '2': printf("two"); break;
case '9': printf("nine"); break;
}
but how the hell we get output for the above code as "one" .. why
"default" not pri
now i got it.. first it checks whether it matches with any case. If it
matches it starts executing from that case until it encounters a
break.
if it doesn't matches with any case then it starts executing from
default and starts executing until a break.
--
You received this message because you are
now the case 9 is matching so it gets executed...n da break statement is
encountered...
On Wed, Mar 23, 2011 at 8:35 PM, cegprakash wrote:
>
>i=9;
>switch(i){
> default: printf("default");
> case 9: printf("one"); break;
> case '2': printf("two");
@cegprakash Relax shut down your computer for some time and switch on your
i-pod.:)
On Wed, Mar 23, 2011 at 8:37 PM, cegprakash wrote:
> now i got it.. first it checks whether it matches with any case. If it
> matches it starts executing from that case until it encounters a
> break.
> if it
@cegprakash Relax shut down your computer for some time and switch on your
i-pod.:)
On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh wrote:
> @cegprakash Relax shut down your computer for some time and switch on your
> i-pod.:)
>
>
>
> On Wed, Mar 23, 2011 at 8:37 PM, cegprakash wrote:
>
ascii values da...not 9
On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh wrote:
> @cegprakash Relax shut down your computer for some time and switch on your
> i-pod.:)
>
> On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh wrote:
>
>> @cegprakash Relax shut down your computer for some time and
i=9;
switch(i){
xxx: printf("default");
yyy:printf("hello");
asdfasdf: printf("why no errors and why not printed");
case '1': printf("one");
default:
switch(i){
case '1': printf("one"); break;
Write switch and you will get error.They are not treated as labels.Read
about : operator.
On Wed, Mar 23, 2011 at 8:46 PM, cegprakash wrote:
> i=9;
>switch(i){
> xxx: printf("default");
> yyy:printf("hello");
> asdfasdf: printf("why no errors and why
what is the use of labels in switch
--
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 mo
sorry i mean case
On Wed, Mar 23, 2011 at 8:49 PM, saurabh singh wrote:
>
> Write switch and you will get error.They are not treated as labels.Read
> about : operator.
>
> On Wed, Mar 23, 2011 at 8:46 PM, cegprakash wrote:
>
>> i=9;
>>switch(i){
>> xxx: printf("default");
>
@dave:
Very nice answer yaar..Excellent !!!
On Wed, Mar 23, 2011 at 7:08 PM, Dave wrote:
> It is LCM(2,3,4,5,6,7,8,9,10) - 1 = 2^3 * 3^2 * 5 * 7 - 1 = 2519.
>
> LCM = least common multiple.
>
> Dave
>
> On Mar 23, 2:41 am, Lavesh Rawat wrote:
> > *A Remainder is chasing me Problem Solution*
> >
yes correct...2519 is the answer
On Wed, Mar 23, 2011 at 7:08 PM, Dave wrote:
> It is LCM(2,3,4,5,6,7,8,9,10) - 1 = 2^3 * 3^2 * 5 * 7 - 1 = 2519.
>
> LCM = least common multiple.
>
> Dave
>
> On Mar 23, 2:41 am, Lavesh Rawat wrote:
> > *A Remainder is chasing me Problem Solution*
> > *
> > *I j
@Dave : like !
On Wed, Mar 23, 2011 at 11:14 PM, Kunal Patil wrote:
> @dave:
> Very nice answer yaar..Excellent !!!
>
>
> On Wed, Mar 23, 2011 at 7:08 PM, Dave wrote:
>
>> It is LCM(2,3,4,5,6,7,8,9,10) - 1 = 2^3 * 3^2 * 5 * 7 - 1 = 2519.
>>
>> LCM = least common multiple.
>>
>> Dave
>>
>> On Ma
hi i got till the third round of technical interview out of the four rounds
and got eliminated in third round.anyways thnx for ur support dude :-)
On Tue, Mar 22, 2011 at 12:51 PM, balaji a wrote:
> Thnx :-) I am from SSN College of Engineering,Chennai
>
>
> On Tue, Mar 22, 2011 at 12:28
kul man...wud appreciate if u cud post your question
On Wed, Mar 23, 2011 at 11:28 PM, balaji a wrote:
> hi i got till the third round of technical interview out of the four rounds
> and got eliminated in third round.anyways thnx for ur support dude :-)
>
>
> On Tue, Mar 22, 2011 at 12:51 PM
hi people, could someone tell me in detail what all things to prepare for
amazon including the resources to consult for the same?? it would be really
helpful
On Thu, Mar 24, 2011 at 12:11 AM, Akash Mukherjee wrote:
> kul man...wud appreciate if u cud post your question
>
>
> On Wed, Mar 23, 2011
Here is another function which probably does not operate the way you
intended, but which meets the specifications.
bool uniform()
{
static unsigned int count;
if (non_uniform()) ++count;
return ((count >> 31) == 1);
}
On Mar 17, 9:24 am, saurabh agrawal wrote:
> Given a function which ret
First I had a paper pen coding round. The questions were:
1) There are two sorted linked lists. Write a code to return the merged
linked list which is also sorted. No additional nodes must be used.
2) Design a DS that would do Push(),Pop(), and GetMax() elements at
complexity O(1)
3) Do a BFS
The main thing they are testing is Problem Solving and the Algorithm
Designing ability. Coding Ability is only next. If you have good knowledge
in Data Structures and good Problem Solving skills with coding ability you
can easily crack through the interview. This is what i infered from my
experienc
Guys,
My intention was to understand how to manage max heap of k size into
memory. Means we have millions of numbers that we can't load into RAM
then how in the very first go we going to load only k size and how
will track of rest numbers. Can anybody code it? Do we need file to
store million numb
Hi
I have been working on a progrmming judge that can be deployed in my
college.I have already developed a prototype in bash.I want it to be as
general as possible,just like spoj,but i also want to add features to it
like copying of source code.Moreover to analyse the design of the code i
need a
On Thu, Mar 24, 2011 at 10:19 AM, saurabh singh wrote:
> Hi
> I have been working on a progrmming judge that can be deployed in my
> college.I have already developed a prototype in bash.I want it to be as
> general as possible,just like spoj,but i also want to add features to it
> like detectin
@Ankit: You read in the first k numbers and form a max-heap of these
numbers. This takes O(k) space. Then you read the rest of the file one
number at a time. If the number is greater than the root of the max
heap, then it is not one of the k smallest numbers. If it less than
the root, replace the r
yesterday one of the my friends asked this Q to me prove with
correctness that
"Every even integer greater than 2 can be expressed as the sum of two
primes"
e.g
4 = 2 + 2
6 = 3 + 3
10 = 7 + 3 or 5 + 5
14 = 3 + 11 or 7 + 7
Explain & Derive The Time ,Space Complexity of Algor
First start 7 & 4. Turn 4 as soon as it is over. Then turn 7 as soon as it
is over. By this time 7 minutes are gone and there is one minute left in 4.
So by the time 4 is over, 7 has 6 mintes left. Then immediately invert 7,
which will count the last one Minute.
7,4 - 3,0 - 3,4 - 0,1 - 7,1 - 6,0 -
Design a system to manage clock room ( used at railway station). Like
what data structure, how ? U need to give O(1) time solution + small
space complexity.
Thanks
Shashank Mani
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to t
*Desert Gold Problem Solution*
Two men found a whole bag of sand gold (its not solid) treasure in the
desert. Time came when they had to split thier ways and devide this whole
bag. However, they dont have any kind of measuring equipment/tool. Nothing.
Just 2 bags. (of course, one is full with sand
How you will print the 100th power of a single digit( which is of type
int). How do you maintain that big number in memory?
Lets C The Approach
Thank & Regards
Shashank
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group,
49 matches
Mail list logo