Registration Started.1 Rs at stake.Event starts at 7.30 PM today.
--
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
try indiabix.com
--
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
Maybe the code has lot of dynamic updations..So for each kind of i/
p there can be different places where the updated value is used.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@shiva , U didn't check for the cycles.Since in question it is never
mentioned about cycles u can add few steps to check cycles.
(eg)
1 3 - 5
| |
| |
| |
4-3--3
--
You received this message because you are subscribed to the Google Groups
Algorithm
Problem D: Numbered Grid
A grid of size N rows and M columns is filled with numbers, one in
each cell. You start at the centre of the cell at the top-left corner
(1,1) and your destination is the centre of the cell at the bottom-
right corner(N,M). In each step, you are only allowed to move to
it is very simple..just think that for sufficiently large n...the
number of times the loop runs will be depend upon wat ?
for example
for(int i=0 to n)
{
for(int =0 to n)
{
//operations
//
}
}
for this the time complexity is O(n^2)
because for every i..it runs n times.
for lg n
for the first one it is permutation with repetition
because the order matters
n = no of digits
When you have *n* things to choose from ... you have *n* choices each time!
So when choosing *r* of them, the permutations are:
*n × n × ... (r times) = nr*
correct me if am wrong
--
You received
here r is numbers we choose usually we have 10 numbers(in case of cell
phone) we have 10[0.9] digits so 10^10 numbers are there...correct
me if am wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
i couldn't find any link here.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
Please some one provide link or source code for Prim's algorithm
using min heap Am having trouble with the implementation
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
#includeiostream
using namespace std;
int main()
{
int n,temp,ans=1;
cin n;
temp=n/8;
temp++;
cout hi temp\n;
while(temp--)
{
temp=temp3;
}
cout temp;
return 0;
}
--
You received this message because you are subscribed to the Google
http://michael.dipperstein.com/rle/index.html
Step 1. Set the previous symbol equal to an unmatchable value.
Step 2. Read the next symbol from the input stream.
Step 3. If the symbol is an EOF exit.
Step 4. Write out the current symbol.
Step 5. If the
Modeling Expert 's code is greedyit won't work for the test cases
in which the optimal answer is does not lie between first two
numbers..
On 9/23/10, Srinivas lavudyasrinivas0...@gmail.com wrote:
can anyone post this answer pls??
--
You received this message because you are
isn't it supposed to be only O(n) questions.?
On 9/23/10, santhosh santhos4...@gmail.com wrote:
if the possibilty of a person knowing other any1 based circular linked.. ie.
1/n..
then none becomes celebrity .. so wat to do in tat situation??
--
You received this message because you are
And what if more than one person in that set?...let it be c. so u
must ask ac+1(n-1) questions right?
On 9/23/10, Soundar soundha...@gmail.com wrote:
isn't it supposed to be only O(n) questions.?
On 9/23/10, santhosh santhos4...@gmail.com wrote:
if the possibilty of a person knowing
1)Sort the first 10 elements (first window)
2)initialise i=1,l=j=10
3)last element is the maximum(l=10) printf(a[l])
4)i=i+1,j=j+1 if(a[j]a[l])
then printf(a[j])
l=j
5)else printf(a[l])
6)if(i==l)
repeat from step 1
for worst case it needs 10 sorts
Correct if i am wrong
--
You
You are correct ...It depends on the max element's index...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
1)get the numbers
2)Sort the numbers
3)traverse from first number
4)if (a[i]==a[i+1]-1 )
{
count++;
sum+=(a[i]+a[i+1])
i++;
}
5)if (summax)
{
end=count;
max=sum;
}
6)print down to count no of elements from a[end]
will this algorithm wok?correct me if i am
but the 2 consecutive numbers condition violatesfor -1 we must
take only -1 only then we get -1 .If u add 2 negative numbers the
answer is less than the 2 elements..So if the array contains ONLY
negative numbers the maximum sum can't be achieved for 2
elements.Correct me if i am
array index starting from 0 or 1?
in the for loop i =length isn't it?
If no please explain
On 9/19/10, Ashish Goel ashg...@gmail.com wrote:
this is google question
take arrays before[] and after
before[0]=1
after[length-1]=1;
for (int i=1; ilength;i++)
{
before[i]=a[i]*before[i-1];
Even if u are connected to that person via some another friend it'll
show the shortest chain by which you are connected to that
person..So DFS will be optimum i guessWhy do you think it
wouldn't be optimum.?
--
You received this message because you are subscribed to the Google
we can use map mapint,string
we have to manipulate 4 type of maps..
1)1-9
2) 10 - 20
3)21-99
3)then hundreds,thousands
correct me if i am wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
for n=190 there it'll give segmentation error.but it contains
only 19 elements
you have to do like x=n/100
then one[x]
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To
#include iostream
#include cstring
#include conio.h
using namespace std;
int main()
{
int n,a[30],temp[30],x;
cin n;
memset(temp,0,sizeof(temp));
for(int i=0;in;i++)
cin a[i];
cin x;
temp[x-a[0]]=1;
for(int i=1;in;i++)
{
if(temp[a[i]]==1)
From first linked list set flag value in each traversal of
node..then start from second linked list suppose if flag value is
already set that is the intersection point
correct me if i am wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
www.spoj.pl
www.topcoder.com/tc
www.codechef.com
Solve problems from these sites..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send
It is giving me error.invalid cast from type ‘main()::node’
to type ‘char*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
can you explain?thanks 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 algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more
u didn't give any name for the structure so it'll give error.correct
me if i am wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email
try DFS
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group
post the problem link
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
Finding the longest increasing sub sequence and comparing with the
original array ...will this method work?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe
Pl provide some test cases or more like examples
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
33 matches
Mail list logo