Re: [algogeeks] Re: constant

2011-10-05 Thread ankit sablok
take a look at this and this is exactly the reason why it works :)

http://stackoverflow.com/questions/3801557/can-we-change-the-value-of-a-constant-through-pointers

On Thu, Oct 6, 2011 at 9:55 AM, Raghav Garg rock.ragha...@gmail.com wrote:

 *it is perfectly working in turbo c. can anyone explain how it can change
 the value of constant variable.
 *Thanking you

 *With regards-
 Raghav garg
 Contact no. 9013201944
 www.facebook.com/rock.raghavag
 B. tech (IT), 5th sem
 University School Of Information Technology
 Guru Govind Singh Indraprastha University
 Delhi*




 On Thu, Oct 6, 2011 at 9:52 AM, SUDHIR RAHEJA 
 raheja.sudhirah...@gmail.com wrote:

 its working..

 #includeconio.h
 #includestdio.h
 int main()
 {const int a=123;
 printf(%d\n,a);

 *(int *)a=345;
 printf(%d,a);
 getch();

 }

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] explain the putput of this program

2011-09-03 Thread Ankit Sablok
#includeiostream
#includecstdio
#includecctype
#includecstdlib
#includecstring

using namespace std;

int main()
{
 int **h;
 int a[2][2]={1,2,3,4};
 h= (int **)a;
 int i,j;
 printf(\n%d,*h);
 (*h)++;
 printf(\n%d,*h);
getchar();
getchar();

return 0;
}

gives an output 1 and 5 why?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Doubt regarding the escape sequences

2011-08-28 Thread ankit sablok
How can I store an escape sequence at each character of the string
when i give the string as an input to the program? Can anybody suggest
me something other than the method i mention below

#includeiostream
#includecstdio
#includecstring

using namespace std;

int main()
{
char s[100];

for(int i = 0 ; i  100 ; ++i)
cins[i];
return 0;
}

If anyone can give me a method using gets() function in C i will be
grateful

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread ankit sablok
finding min will not take O(1) time in a stack i guess

On Mon, Aug 1, 2011 at 10:32 AM, kartik sachan kartik.sac...@gmail.comwrote:

 I think its stack  where deletion insertion and finding min (as we will cal
 min at the time of insertion only by taking min val ) will take O(1) time

 correct me if i am worng...!

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] GETS

2011-07-19 Thread Ankit Sablok
the gets function gives me error when i execute the following code
plzz provide suggestions and answers

char str[100];

while(n--)
{
  gets(str);
  puts(str);
}

suggest alternative methods to solve the anomaly

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: GETS

2011-07-19 Thread Ankit Sablok
Y is it not recommended to use gets in g++ what is the exact reason
can u tell

On Jul 19, 4:47 pm, SAMMM somnath.nit...@gmail.com wrote:
 You can try this :-

 fgets(buff,sizeof(buff),stdin) ..
 It is recomended not to use gets in g++ or gcc ..

 On Jul 19, 4:40 pm, Ankit Sablok ankitsablok19091...@gmail.com
 wrote:







  the gets function gives me error when i execute the following code
  plzz provide suggestions and answers

  char str[100];

  while(n--)
  {
    gets(str);
    puts(str);

  }

  suggest alternative methods to solve the anomaly

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] SDE online test

2011-07-14 Thread ankit sablok
where is the link man

On Thu, Jul 14, 2011 at 5:28 PM, mohit mohit89m...@gmail.com wrote:

 Hey guys , is amazon conducting online test for SDE post?

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Nagarro Question

2011-06-26 Thread Ankit Sablok

Need a Better Algorithm

here is a trivial question we are given an array of 2n elements in the
form
{a1,a2,a3,..,an,b1,b2,b3b...bn}

we need to output a resultiing array in the form
{a1,b1,a2,b2,an,bn}
but without using another array here is my algorithm which uses nested
loops can anyone provide a better solution which doesnt involve
shifting.

int i,j,k,temp;
j=num;

int Interleave(int *arr)
{

for(i=1;i2*num - 1;i+=2)
{
  temp = arr[j];

  for(k=j;k=i+1;--k)
  arr[k]=arr[k-1];

  arr[i] = temp;
  ++j;
}
}

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Algorithmic Pioneers

2011-06-23 Thread ankit sablok
very nice man nice collection add Petr Mitrichev to this collection

On Fri, Jun 24, 2011 at 11:14 AM, rShetty rajeevr...@gmail.com wrote:

 Collection of Algorithmic Pioneers can be Found here

 http://openprobe.blogspot.com/2011/06/pioneers-in-algorithm-deisgn-and.html

 Suggestion for addition of more Pioneers are welcome .

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] help me wd the following problem

2011-06-15 Thread Ankit Sablok
Hello friends I am thinking of a combinatorics solution to this
problem on spoj but cant come up wd a formula please suggest me some
technique to solve this problem

http://www.spoj.pl/problems/CHAIR/

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Request for books

2011-06-05 Thread Ankit Sablok
If some one has the following books

Algorithms and Data structures in C - Mark Allen Weiss
Network Flow Algorithms - by Ahuja

please mail it to ankitsablok19091...@gmail.com

thanxx 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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Request for books

2011-06-05 Thread Ankit Sablok
also if one can mail me all the versions of sedgewick I will b
grateful

On Jun 5, 6:40 pm, Ankit Sablok ankitsablok19091...@gmail.com wrote:
 If some one has the following books

 Algorithms and Data structures in C - Mark Allen Weiss
 Network Flow Algorithms - by Ahuja

 please mail it to ankitsablok19091...@gmail.com

 thanxx 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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Reuest for a book

2011-05-08 Thread ankit sablok
Please mail the book Data Structures and Algorithms in C by Mark
Allen Weiss to the following Id - ankit4...@gmail.com
if anyone has d book

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
@all please dnt give the solution to above problem as its a recrutiment
problem and recrutiment is still in process

On Mon, Apr 25, 2011 at 10:21 PM, hary rathor harry.rat...@gmail.comwrote:

 if eric start from (start of row) and finn start from end of row
 then this method enable the continuous area of 5 islands which will be
 maximum area only if finn dont want to appose ...

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
I request u all please dont post solutions to this problem

On Mon, Apr 25, 2011 at 10:22 PM, ankit sablok ankit4...@gmail.com wrote:

 @all please dnt give the solution to above problem as its a recrutiment
 problem and recrutiment is still in process


 On Mon, Apr 25, 2011 at 10:21 PM, hary rathor harry.rat...@gmail.comwrote:

 if eric start from (start of row) and finn start from end of row
 then this method enable the continuous area of 5 islands which will be
 maximum area only if finn dont want to appose ...

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
coz u received this message from co cubes I got the same but we dont loof
for soltions online

On Mon, Apr 25, 2011 at 10:27 PM, Sudhir mishra
sudhir08.mis...@gmail.comwrote:

 why

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
Anand please dnt give a solution to it i knw its dp but the compettion is
stil open

On Mon, Apr 25, 2011 at 10:35 PM, Anand anandut2...@gmail.com wrote:

 It's a very simple DP Problem.


 On Mon, Apr 25, 2011 at 9:59 AM, ankit sablok ankit4...@gmail.com wrote:

 coz u received this message from co cubes I got the same but we dont loof
 for soltions online


 On Mon, Apr 25, 2011 at 10:27 PM, Sudhir mishra 
 sudhir08.mis...@gmail.com wrote:

 why

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
thanks for not posting a solution to this problem

On Apr 25, 11:28 pm, Anand anandut2...@gmail.com wrote:
 Ok



 On Mon, Apr 25, 2011 at 10:06 AM, ankit sablok ankit4...@gmail.com wrote:
  Anand please dnt give a solution to it i knw its dp but the compettion is
  stil open

  On Mon, Apr 25, 2011 at 10:35 PM, Anand anandut2...@gmail.com wrote:

  It's a very simple DP Problem.

  On Mon, Apr 25, 2011 at 9:59 AM, ankit sablok ankit4...@gmail.comwrote:

  coz u received this message from co cubes I got the same but we dont loof
  for soltions online

  On Mon, Apr 25, 2011 at 10:27 PM, Sudhir mishra 
  sudhir08.mis...@gmail.com wrote:

  why

  --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

   --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

   --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

   --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Please correct the error in my code

2011-04-07 Thread ankit sablok
I have debugged my program from all points of view but i cant find the
cause of a wrong answer for this problem

http://uva.onlinejudge.org/external/4/406.html

here is my source code for the problem

#includeiostream
#includecstdio
#includecstdlib
#includevector
#includeiostream
#includealgorithm
#includecmath
#includeiterator

using namespace std;

#define pb push_back

vectorboolprime; // this vector will hold all the primes

inline int sieve()
{
  int i,j;

  for(i = 0; i = 1000 ; i++)
  prime.pb(true);

  for(i = 2; i*i = 1000 ; i++)
  {
 for(j = 2 ; i*j = prime.size() ; j++ )
 prime[i*j] = false;
  }

  return 0;

}

int main()
{
int i,j,k;

sieve();

int N,C;

while( scanf(%d %d,N,C) == 2)
{

vectorintprimes;

primes.pb(1);

for(i=2;i=N;i++)
if(prime[i])
primes.pb(i);

vectorint::iterator p; // used for pointing to the vector

printf(%d %d: ,N,C);

if((primes.size())%2 == 0)
{
  if(C*2 = primes.size())
  {
for(i=0;iprimes.size();i++)
printf(%d ,primes[i]);
  }

  else
  {
  p=primes.begin();
  p=p+((primes.size() - (2*C))/2);

  for(i=0;i(C*2);i++)
  printf(%d ,*(p+i));
  }
}

else
{
if((C*2 - 1) = primes.size() )
{
  for(i=0;iprimes.size();i++)
  printf(%d ,primes[i]);
}

else
{
p=primes.begin();
p = p + ((primes.size() - (2*C - 1))/2);

for(i=0;i(2*C-1);i++)
printf(%d ,*(p+i));
}
}

printf(\n);

}

getchar();
getchar();

return 0;
}

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Bytes'11

2011-02-19 Thread ankit sablok
man the browser is showing me error problem wtf is dis

On Sat, Feb 19, 2011 at 7:01 PM, rohit kumra rohit.kumra...@gmail.comwrote:

 Play the world cup with your codes here.

 https://www.spoj.pl/BYTES11A/problems/main/

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Bytes'11

2011-02-19 Thread ankit sablok
please look into u all

On Sat, Feb 19, 2011 at 7:11 PM, ankit sablok ankit4...@gmail.com wrote:

 man the browser is showing me error problem wtf is dis


 On Sat, Feb 19, 2011 at 7:01 PM, rohit kumra rohit.kumra...@gmail.comwrote:

 Play the world cup with your codes here.

 https://www.spoj.pl/BYTES11A/problems/main/

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2011-02-19 Thread ankit sablok
all u fuckers please chedck into the problem

On Sat, Feb 19, 2011 at 6:57 PM, Troika'11 by...@dcetech.com wrote:

 Play the world cup here with your codes...

 https://www.spoj.pl/BYTES11A/problems/main/

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Application of Data Structure

2011-02-16 Thread ankit sablok
trie construction would do for this

On Wed, Feb 16, 2011 at 10:15 PM, yv paramesh yv.param...@gmail.com wrote:

 build a tree

 On Wed, Feb 16, 2011 at 10:10 PM, vaibhav agrawal agrvaib...@gmail.com
 wrote:
  Hash, SortedSet
 
  On Wed, Feb 16, 2011 at 9:58 PM, bittu shashank7andr...@gmail.com
 wrote:
 
  Given a set of words one after another, give a data structure so that
  you,will know whether a word has appeared already or not.
 
  Thanks
  Shashank
 
  --
  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 group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
  --
  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 group at
  http://groups.google.com/group/algogeeks?hl=en.
 

 --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: question at K10

2011-02-16 Thread ankit sablok
AX is the low order accumulator register used in the microprocessor
generally the value returned is from the accumulator if u modify that
value it will return the value u set it to
as the Register is Divided into 2 parts AH - higher order and AX -
lower order the value 10 is stored in AX and is returned

On Feb 16, 7:32 am, Balaji S balaji.ceg...@gmail.com wrote:
 The solution is..

    _AX = 10;

 can anyone 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: question at K10

2011-02-16 Thread ankit sablok
nice solution

On Feb 15, 11:22 pm, jagannath prasad das jpdasi...@gmail.com wrote:
 void change()
 {
    #define i i=10,n}

 this will do..

 On Tue, Feb 15, 2011 at 11:33 PM, Rel Guzman Apaza rgap...@gmail.comwrote:







  Nothing... 10 in base 5   =   5 in base 10.

  void change(){
      printf(); //...?
  }

  2011/2/15 Don dondod...@gmail.com

  A semicolon is valid in the middle of a line in C or C++.

  For instance, no one says that

  for(i = 0; i  10; ++i)

  is three lines of code.

  Don

  On Feb 15, 11:31 am, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
   after termination of semicolon , that will be considered a separate line
  i
   guess

   On Tue, Feb 15, 2011 at 10:59 PM, Don dondod...@gmail.com wrote:
void change()
{
 printf(10); while(1) {}
}

On Feb 15, 10:17 am, Balaji S balaji.ceg...@gmail.com wrote:
 Insert only one line in the function change() so that the output of
  the
 program is 10.
 You are not allowed to use exit(). You are not allowed to edit the
function
 main() or to
 pass the parameter to change()

 void change()
 {
 // Code here}

 int main()
 {
 int i=5;
 change();
 printf(“%d” ,i);
 return 0;

 }

--
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 group at
   http://groups.google.com/group/algogeeks?hl=en.

   --
   With Regards,
   *Jalaj Jaiswal* (+919019947895)
   Software developer, Cisco Systems
   B.Tech IIIT ALLAHABAD

  --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

   --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] resource for java programming language

2011-02-07 Thread ankit sablok
Can anyone tell me a nice resource to study java online

also please list some of the most popular books to study the language
that has a lucid and detailed explanation of the libraries and
packages of the java programmiing language needed for competitive
programming please help

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2011-02-05 Thread ankit sablok
x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for
octal constnts

On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan radhakrishnance...@gmail.com
 wrote:

 guess the output

 main()
 {
 int x=(1,024),y;
 y=1,024;
 printf(%d %d,x,y);
 }

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c programming question

2011-02-04 Thread ankit sablok
the output is 22 13 13 as increment and decrement operators associate from
right to left hence first ++a will be evluated which makes a=11 then a++ is
evaluated as its a postfix operation hence b=a+a=11+11=22 and after this a
=12 then in printf statement again right associativity follows hence ++a
sets a=13 and the output is 22 13 13


On Sat, Feb 5, 2011 at 2:04 AM, aniket chatterjee aniket...@gmail.comwrote:

 The answer will be compiler dependent.Google Sequence Point in C.

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Suggest a solution using BFS

2011-01-18 Thread ankit sablok
i have been trying this problem first i brute forced it and i was
right using brute force but can someone suggest a BFS solution to the
problem

http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6page=show_problemproblem=347

suggest something better than brute force

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Suggest a solution using BFS

2011-01-18 Thread ankit sablok
please suggest a solution for this problem using BFS i m nt able to
get how we apply bfs here though brute force would do

http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6

thnxx in advance please explain in detail so that i become able to
tackle such problems in future

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] bfs doubt

2011-01-18 Thread ankit sablok
one possible solution can be that while storing the graph using adjacency
lists u can associate a color variable with each edge so that u color the
edge as u traverse it
like if u want to check wether edge (u,v) has been traversed while
traversing u's adjacecny list check wether (u,v) has been colored while
scanning v's adjacency list or not if so then discard the edge as this
operation will take O(1) time and there is a bound on the number of memory
locations u check which is O(V+E) the time of the algorithm is O(V+E). the
color variable is a single bit variable 0 or 1

correct me if i m wrong and to find a path out of a maze just find the exit
point using BFS.

all corrections are welcomes
thnxx


On Tue, Jan 18, 2011 at 12:06 AM, rahul rai raikra...@gmail.com wrote:

 Let G = (V, E) be a  **, cONNECTED  undirected graph. Give an O(V +
 E)-time algorithm to compute
 a path in G that traverses each edge in E exactly once in each direction.
 Describe how you can
 find your way out of a maze if you are given a large supply of pennies.
 from clrs

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] help me debug this

2011-01-17 Thread ankit sablok
i dont knw wt wrong i have done in this simple problem bt its nt being
accepted at uva judge
here is the link to the problem

http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6page=show_problemproblem=347

please help me debug my code


#includeiostream
#includecstdio
#includevector
#includealgorithm
#includecmath

using namespace std;

int main()
{
int N,C;// the inputs to be scanned
vectorintprimes;//prime array
vectorints;

while(scanf(%d %d,N,C)==2)
{
int i,j,k;// counters
primes.clear();
s.clear();
for(i=0;i=N;i++)
primes.push_back(i);

for(i=2;iprimes.size();i++)
{
  for(j=2;i*jprimes.size();j++)
  primes[i*j]=0;
}

for(i=0;iprimes.size();i++)
{
   if(primes[i]!=0)
   s.push_back(i);
}

   /* for(i=0;is.size();i++)
couts[i]endl;*/
printf(%d\n,s.size());
printf(%d %d: ,N,C);

if((2*C)s.size())
{
  for(i=0;is.size();i++)
  printf(%d ,s[i]);
}

else if((s.size())%2==0)
{
  // the evaluate the number of prime numbers to be left out
  j=(s.size()-2*C)/2;

  for(i=j;i(j+2*C);i++)
  printf(%d ,s[i]);
}

else
{
j=(s.size()-2*C+1)/2;
for(i=j;i(j+2*C-1);i++)
printf(%d ,s[i]);
}

printf(\n);
}

getchar();
getchar();

return 0;
}

thnxx 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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: help me debug this

2011-01-17 Thread ankit sablok
i improved upon my code but still i get a presentation error dunno wts the
judge judging it shows me the correct way when i output test cases on my
compiler but on the judge it says wrong answer or presentation error

#includeiostream
#includecstdio
#includevector
#includealgorithm
#includecmath

using namespace std;

int prime(int N,int C);// the function used to print the cut primes

int main()
{
int N,C;
vectorintv;// used for holding the test cases

while(scanf(%d %d,N,C)==2)
{
  v.push_back(N);v.push_back(C);
}

int i;// counter

for(i=0;iv.size();i+=2)
prime(v[i],v[i+1]);

return 0;
}
int prime(int N,int C)
{
vectorintp;
vectorints;

p.clear();s.clear();

int i,j,k;// counters

for(i=0;i=N;i++)
p.push_back(i);

for(i=2;ip.size();i++)
{
 for(j=2;i*jp.size();j++)
 p[i*j]=0;
}

   for(i=0;ip.size();i++)
   {
  if(p[i]!=0)
  s.push_back(i);
   }

   printf(%d %d: ,N,C);

   if((2*C)s.size())
   {
 for(i=0;is.size();i++)
 printf(%d ,s[i]);
   }

   else if((s.size())%2==0)
   {
 // the evaluate the number of prime numbers to be left out
 j=(s.size()-2*C)/2;
 for(i=j;i(j+2*C);i++)
 printf(%d ,s[i]);
   }

   else
   {
   j=(s.size()-2*C+1)/2;
   for(i=j;i(j+2*C-1);i++)
   printf(%d ,s[i]);
   }
   printf(\n\n);

   return 0;
}


On Tue, Jan 18, 2011 at 1:05 AM, juver++ avpostni...@gmail.com wrote:

 Got AC with your code with small corrections to the output -
 don't use getchar();
 output specification says:  Each line of output should be followed by a
 blank line (so, add blank line to match the sample output)
 you print a whitespace after each number, so the last character in your
 line is a whitespace (but it is wrong, so take a care of this)

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] UVA problems getting wrong answers

2010-12-24 Thread ankit sablok
hii at all i was solving an adhoc problem on uva judge link -
http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8page=show_problemcategory=121problem=208mosmsg=Submission+received+with+ID+8477913

and hers my code for the problem but i get wrong answer every tme
plzzz help me debug the code i dnt think i have missed any test case

the code is as follows

#includeiostream
#includecstdio
#includecstdlib
#includealgorithm
#includevector

using namespace std;

int main()
{
char str[1];// string of characters

int i,j,k;// counter variables
int len;// stores the length of the string

while(gets(str)!=NULL)
{
   len=strlen(str);

   vectorcharv;
   j=0;
   k=0;

   for(i=0;ilen;i++)
   {
   if(str[i]==34)
   {
  ++j;

  if(j%2!=0)
  {
v.push_back(96);
v.push_back(96);
  }

  else
  {
  v.push_back(39);v.push_back(39);
  }
   }
   else
   {
   v.push_back(str[i]);
   }
   }

   vectorchar::iterator p;
   p=v.begin();

   while(p!=v.end())
   {
   cout*p;
   ++p;
   }

   v.clear();
   coutendl;
}

getchar();
getchar();

return 0;
}

thnx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] ankit sablok wants to chat

2010-12-20 Thread ankit sablok
---

ankit sablok wants to stay in better touch using some of Google's coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-a96b6b68ce-69e1b8743a-fR2v0p_gvlyJsBnTMH_Mq01Kcnk
You'll need to click this link to be able to chat with ankit sablok.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with ankit sablok, visit:
http://mail.google.com/mail/a-a96b6b68ce-69e1b8743a-fR2v0p_gvlyJsBnTMH_Mq01Kcnk

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
  emails into conversations
- No pop-up ads or untargeted banners - just text ads and related information
  that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
  client

We're working hard to add new features and make improvements, so we might also
ask for your comments and suggestions periodically. We appreciate your help in
making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).

-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Array Transform

2010-12-18 Thread ankit sablok
Can any body provide me a program for the following question

thanx in advance

http://www.codechef.com/problems/ARRAYTRM/

I am applying brute forc here and getting TLE everytime help me out
with the problem thanx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Adobe Interview Question

2010-12-14 Thread ankit sablok
what i think is that the number of times foo2 being called is
independent of the percentages given in the question it may be called
5000 times or 4999 times and continuinf in this fashion also none of
the times as in every case there's 1/4 probability of AB and 3/4 of
CD so as per me we cannot decide givn the percentage of success and
failure any suggestions are always welcomed

On Dec 15, 12:06 am, bittu shashank7andr...@gmail.com wrote:
 void foo1()
 {
   if(AB)
     Then {_/* */}
   else
    if(CD)
      then foo2()

 }

 How many time foo2() would get called given
 AB 25% of the times and CD 75% of the times and foo1() is called
 5000 times

 although i had diff...solution..but i wants to confirm wid others..so
 hav a look

 Regards
 Shashank Mani
 BIT Mesra

-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Adobe Interview Question

2010-12-14 Thread ankit sablok
well i still believe that the calling of foo2 is independent plzzz suggest
me the solution if i am wrong a detailed one thanx in advance

On Wed, Dec 15, 2010 at 1:22 AM, Saurabh Koar saurabhkoar...@gmail.comwrote:

 The function foo2 will be called iff the condition if(CD) evaluates to be
 true.
 Given that CD turns out to be true 75% times.So why the call to foo2
 will be independent??
 I think it is only the simple math.Correct me if I am wrong..

 On 12/15/10, ankit sablok ankit4...@gmail.com wrote:
  what i think is that the number of times foo2 being called is
  independent of the percentages given in the question it may be called
  5000 times or 4999 times and continuinf in this fashion also none of
  the times as in every case there's 1/4 probability of AB and 3/4 of
  CD so as per me we cannot decide givn the percentage of success and
  failure any suggestions are always welcomed
 
  On Dec 15, 12:06 am, bittu shashank7andr...@gmail.com wrote:
  void foo1()
  {
if(AB)
  Then {_/* */}
else
 if(CD)
   then foo2()
 
  }
 
  How many time foo2() would get called given
  AB 25% of the times and CD 75% of the times and foo1() is called
  5000 times
 
  although i had diff...solution..but i wants to confirm wid others..so
  hav a look
 
  Regards
  Shashank Mani
  BIT Mesra
 
  --
  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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
just search for the word in the document using an efficient string matching
algorithm
use Knuth Morris Pratt algorithm as it runs in O(m) time.

or use a data structure called TRIE
where u can search for the word in O(1) time any suggestions are always
welcomed

On Fri, Dec 10, 2010 at 3:13 PM, GOBIND KUMAR gobind@gmail.com wrote:

 Help me in solving this problem...   Define a data struct for the search 
 engine which will represent whether

 given word is there in the document or not .It  should be fast.

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: program for evaluation of remainders

2010-12-10 Thread ankit sablok
@Dave
we will use residues then i think the property of modulus

1!mod997 + 2!mod997 + 3!mod997 .. + 997!mod997

i just proposed the solution using congruences for the case
nN

can u generalize the problem using congruences if so then please post
it
thnanx in advance

On Dec 9, 2:13 am, Dave dave_and_da...@juno.com wrote:
 @Ankit: So how does that work with, e.g., N = n = 997? I.e., what is
 the calculation?

 Dave

 On Dec 8, 11:33 am, ankit sablok ankit4...@gmail.com wrote:



  @ all the authors thanx for the suggestions actually wt i know about
  the problem is i think we can solve the problem mathematically if we
  know about congruences

  for instance
  if N=100
  1! + 2! + . + 100!
  and n=12

  we find that
  4!mod24=0

  hence the above equation reduces to the
  (1!+2!+3!)mod 12 =9
  hence the answer is 9

  so can anyone write a program for this logic

  On Dec 8, 6:19 pm, ankit sablok ankit4...@gmail.com wrote:

   Q) can anyboy find me the solution to this problem

   Given an integer N and an another integer n we have to write a program
   to find the remainder of the following problems
   (1! + 2! + 3! + 4! + . + N!)mod(n)

   N=100
   n=1000;

   please help me write a program for this problem
   thanx in advance- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] just confirming my answer

2010-12-10 Thread ankit sablok
Q) an n-input m-output boolean function is defined as follows

(F:{True,False}^n-{True,False}
^m)

find the number of n X 1 functions meaning n inputs and 1 output
and n X m funcrtions meaning n inputs and m outputs

my answer

at any time we can reduce the problems as follows

in the domain we will always be havibg n input variables and the co-
domain can be thought of as having 2 values {True and False}
condisering this i get the number of n X 1 functions as
2^n. Please do suggest me the alternative if i am wrong. thanx in
advance

and the nswer reamins the sam for me in case of finding the number of
n X m functions.

Please help me out if i m wrong in solving this thanx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
then u can just use or build a dynamic dictionary of words as done in LZW
coding such that if the word is there in the dictionary it just gives u the
indx of the word and if its not it just adds that word to the dictionary any
suggestions are always welcomed thnx in advance

On Fri, Dec 10, 2010 at 4:08 PM, manoj lalavat manoj.lala...@gmail.comwrote:

 it will give you an idea.

 http://en.wikipedia.org/wiki/Full_text_search


 On Fri, Dec 10, 2010 at 4:03 PM, ADITYA KUMAR aditya...@gmail.com wrote:

 @ankit
 u can'nt use TRIE
 becoz , input will be given in form of text
 so generating the TRIE will be much expensive than linear search

 On Fri, Dec 10, 2010 at 3:13 PM, GOBIND KUMAR gobind@gmail.comwrote:

 Help me in solving this problem...   Define a data struct for the 
 search engine which will represent whether

 given word is there in the document or not .It  should be fast.

  --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Regards
 Aditya Kumar
 B-tech 3rd year
 Computer Science  Engg.
 MNNIT, Allahabad.

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 --
 Manoj Lalavat


 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] program for evaluation of remainders

2010-12-08 Thread ankit sablok
Q) can anyboy find me the solution to this problem

Given an integer N and an another integer n we have to write a program
to find the remainder of the following problems
(1! + 2! + 3! + 4! + . + N!)mod(n)

N=100
n=1000;

please help me write a program for this problem
thanx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] help me reduce the time limit

2010-12-08 Thread ankit sablok
please help mewritea program for this problem to reduce the time limit

http://www.codechef.com/problems/FLIPCOIN/

thnx in advance i have ben banging my head on this for a full day

-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: program for evaluation of remainders

2010-12-08 Thread ankit sablok
@ all the authors thanx for the suggestions actually wt i know about
the problem is i think we can solve the problem mathematically if we
know about congruences

for instance
if N=100
1! + 2! + . + 100!
and n=12

we find that
4!mod24=0

hence the above equation reduces to the
(1!+2!+3!)mod 12 =9
hence the answer is 9

so can anyone write a program for this logic


On Dec 8, 6:19 pm, ankit sablok ankit4...@gmail.com wrote:
 Q) can anyboy find me the solution to this problem

 Given an integer N and an another integer n we have to write a program
 to find the remainder of the following problems
 (1! + 2! + 3! + 4! + . + N!)mod(n)

 N=100
 n=1000;

 please help me write a program for this problem
 thanx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] help me find a solution

2010-12-08 Thread ankit sablok
can anyone suggest me how to go about this problem i m finding it
quite tough

http://www.codechef.com/problems/TEAMSEL/

thanx 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 options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Amazom interview question

2010-12-04 Thread ankit sablok
this is the general task scheduling problem apply greedy algorithms

On Sat, Dec 4, 2010 at 10:13 AM, Prims topcode...@gmail.com wrote:

 You are given 'n' appointments. Each appointment contains startime and
 endtime. You have to retun all conflicting appointments efficiently

 starttime and endtime can range from a few min to few years.

 --
 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.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] GOOGLE SUMMER OF CODE

2010-11-21 Thread ankit sablok
WHEN IS GOOGLE SUMMER OF CODE 2011 BEGINING AND HOW CAN WE APPLY FOR
IT AND WHAT ARE THE ELIGIBILITY CRITERIA FOR THE APPLICATION.
PLEASE HELP ME OUT WITH THIS APPLICATION PROCEDURE...

THNXX IN ADVANCE

ANKIT SABLOK
B.TECH
COMPUTER SCIENCE AND ENGG

-- 
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 at 
http://groups.google.com/group/algogeeks?hl=en.