Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
yeah .. the input will bw given that only for which solution  is possible

On Wed, Feb 9, 2011 at 1:18 PM, Jitesh Kumar jitesh2...@gmail.com wrote:

 Can you give me solution for N=1 and N=2?
 I don't think that it is possible for every N.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send 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
Final Year Undergraduate,
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.



Re: [algogeeks] amazon

2011-02-09 Thread Jitesh Kumar
For N=3, multiple solutions exists
3 1 2 1 3 2
2 3 1 2 1 3

what about this??

On Wed, Feb 9, 2011 at 1:35 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:

 yeah .. the input will bw given that only for which solution  is possible

 On Wed, Feb 9, 2011 at 1:18 PM, Jitesh Kumar jitesh2...@gmail.com wrote:

 Can you give me solution for N=1 and N=2?
 I don't think that it is possible for every N.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send 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
 Final Year Undergraduate,
 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.



Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
This is not a solution dude
in the solution the sum of any 2 consecutive nos shld be a perfect square :)

On Wed, Feb 9, 2011 at 2:19 PM, Jitesh Kumar jitesh2...@gmail.com wrote:

 For N=3, multiple solutions exists
 3 1 2 1 3 2
 2 3 1 2 1 3

 what about this??


 On Wed, Feb 9, 2011 at 1:35 PM, jalaj jaiswal 
 jalaj.jaiswa...@gmail.comwrote:

 yeah .. the input will bw given that only for which solution  is possible

  On Wed, Feb 9, 2011 at 1:18 PM, Jitesh Kumar jitesh2...@gmail.comwrote:

 Can you give me solution for N=1 and N=2?
 I don't think that it is possible for every N.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send 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
 Final Year Undergraduate,
 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.




-- 
With Regards,
*Jalaj Jaiswal* (+919019947895)
Software developer, Cisco Systems
Final Year Undergraduate,
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.



Re: [algogeeks] amazon

2011-02-09 Thread Jitesh Kumar
I didn't get you..
In your example

One of the possible placement for 7 numbers in 14 positions is :
5 7 2 3 6 2 5 3 4 7 1 6 1 4

there is no  perfect square...

-- 
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] c++ program

2011-02-09 Thread Anil Kumar aRY@
Write a program that reads a contents of webpages?

-- 
*Anil Kumar Arya*
*B.Tech 2nd Year*
*Motilal Nehru National Institute of Technology,*
*Allahabad*
*211004*
*Email id:-**aryaanil...@gmail.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 this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
@ jitesh i am sorry
that was for a different question

yeah your interpretation is right

On Wed, Feb 9, 2011 at 3:02 PM, Jitesh Kumar jitesh2...@gmail.com wrote:

 I didn't get you..
 In your example

 One of the possible placement for 7 numbers in 14 positions is :
 5 7 2 3 6 2 5 3 4 7 1 6 1 4

 there is no  perfect square...

 --
 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
Final Year Undergraduate,
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.



Re: [algogeeks] CODECHEF FLIP COIN problem

2011-02-09 Thread Arpit Sood
there is problem with the update function...

On Tue, Feb 8, 2011 at 8:14 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 Hey thanks for your help
 I have written a code using range trees but I am still getting TLE [?][?][?]
 Please suggest me something


 Here is my code

 /*
  * File:   main1.c
  * Author: gs
  *
  * Created on 8 February, 2011, 7:46 PM
  */

 #include stdio.h
 #include stdlib.h


 #define MAX 30
 #define loop0(i,j) for(int i=0;ij;i++)
 #define loop1(i,j) for(int i=1;ij;i++)
 # define true 1
 # define false 0


 _Bool flag[MAX];
 int value[MAX];

 /*void initialize(int node, int b, int e)
 {
 if (b == e)
 {
 flag[node] = false;
 value[node] = 0;
 }
 else
 {
 initialize(2 * node, b, (b + e) / 2);
 initialize(2 * node + 1, (b + e) / 2 + 1, e);
 value[node] = 0;
 flag[node] = false;
 }
 }*/

 int update(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if(b==e)
 {
 if(flag[node] == true)
 return 1;
 else
 return 0;
 }
 if (b = i  e = j)
 {
 if(flag[node] == true)
 {
 flag[node] = false;
 flag[2*node] = !flag[2*node];
 flag[2*node+1] = !flag[2*node+1];
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return (value[node] = p1 + p2);
 }
 else
 return value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return value[node] = p1 + p2;
 }
 }

 int query(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if (b = i  e = j)
 {
 flag[node] = !flag[node];
 return value[node] = e - b + 1 - value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = query(2 * node, b, (b + e) / 2, i, j);
 p2 = query(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 if(p1==-1)
 p1=0;
 if(p2==-1)
 p2=0;
 return (value[node] = p1 + p2);
 }
 }

 int main()
 {
int i, n, q,ret;
int cmd, a, b, z;
scanf(%d %d,n,q);
//initialize(1, 0, tests-1);
for(i=0;i q;i++)
{
scanf(%d %d %d,cmd,a,b);
if(cmd==0)
value[1] = query(1,0,n-1,a,b);
else
printf(%d\n,update(1,0,n-1,a,b));
}
return 0;

 }




 On Tue, Feb 8, 2011 at 3:41 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 make a tree where each node have the following structure

 1. rangeLow
 2. rangeHigh
 3. headCount of its complete subTree
 4. boolean variable change, if true means all nodes of that subtree need
 to be flipped but we are not flipping in the hope if again a flip occur we
 can reset the flag and we can save some time
 5.isHead

 initialise range tree as for root range 0-MAX
 leftSubTree 0-MAX/2 rightSubTree MAX/2+1 - MAX
 all headCount initially 0
 all changes to false

 as a query comes, if it matches with range of some node we can stop
 propagating at that level and making change true so no need to go till leaf
 nodes
 new head count at that node will be (total nodes in its range - prev
 headCount)


 if you are still not able to get it you should read a range tree tutorial,
 that will really help

 On Tue, Feb 8, 2011 at 2:28 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 Actually I could not figure out any good way of doing this . [?][?]
 Could you please suggest me something or give some idea .
 Thanks for helping

 On Tue, Feb 8, 2011 at 1:51 PM, sunny agrawal 
 sunny816.i...@gmail.comwrote:

 i think time complexity of the O(nlgn) for an avg case will suffice

 no it will not be inefficient if we keep sufficient information at each
 node
 each node will keep information of all its childs(headCount) and using
 some optimizations such as if two flips on same range occur simultaneously,
 then after all there will be no effect at all so there was no need of doing
 anything.

 On Tue, Feb 8, 2011 at 1:27 PM, Gaurav Saxena 
 grvsaxena...@gmail.comwrote:

 If we make segments of the range of coins which are heads then in some
 case the result will become alternate which could be more inefficient. Any
 idea what time complexity will suffice ?
 Could you please elaborate your reply .


 On Tue, Feb 8, 2011 at 1:08 PM, sunny agrawal sunny816.i...@gmail.com
  wrote:

 i think your solution will be O(n) for each query
 so it will be 

[algogeeks] m-permutation

2011-02-09 Thread punnu
Suppose n people are arranged in a circle. Number the people from 1 to
n. in the clockwise order. We are given an integer ,m = n. Beginning
with the person with designated number 1, we proceed around the circle
(in clockwise order) removing every mth person. After each person is
removed, counting continues around the circle that
remains. This process continues until all the n people have been
removed. . The .m-permutation is defined as the order in which the
people have been removed. As an example, if n = 7, m = 3, then the 3 -
permutation is 3,6,2,7,5,1,4.
Give an O(n log n) time algorithm which given m and n outputs the m-
permutation.

-- 
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: Meetings puzzle

2011-02-09 Thread Ujjwal Raj
Input: n meetings
A meeting e(i) has start time s(i) and finish time f(i).
Sort n events based on there finish time f(i)
Say sorted meeting(based on finishing time) are:
e1,e2,e3,e4,...en

E(t): denotes the maximum no of meetings conducted where 0 = time = t.

E(f1) = e1
E(f2) = max(E(s2) + 1), E(f1));
E(f3) = max(E(s3)+1), E(f2));

Make array of E based on finishing times.
So your array will have values of E at different finishing times
f1 E1
f2, E2
f3 E3
f4 E4

so E2 means maximum no of events between time = f2 and  f3.

Hope it is now clear.

On Wed, Feb 9, 2011 at 12:59 PM, Sachin Agarwal
sachinagarwa...@gmail.comwrote:

 didn't quite get it, can you please elaborate.
 thanks

 On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com wrote:
  Use dynamic programming:
  1) Sort the events in order of finishing time.
  f1, f2, f3, f4, ... fn
 
  E(fn) = E(sn) + 1;
  Solve the above recursion
  sn is start time of event n
 
  On Wed, Feb 9, 2011 at 11:30 AM, Sachin Agarwal
  sachinagarwa...@gmail.comwrote:
 
 
 
 
 
 
 
   Suppose I have a room and I want to schedule meetings in it. You're
   given a list of meeting start and end times. Find a way to schedule
   the maximum number of meetings in the room.
 
   --
   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.



Re: [algogeeks] c++ program

2011-02-09 Thread Anil Kumar aRY@
thanx

On Wed, Feb 9, 2011 at 3:47 PM, Rajeev Kumar rajeevprasa...@gmail.comwrote:

 I don't know about cpp.But you can do it using selenium framework...

 On Wed, Feb 9, 2011 at 3:04 PM, Anil Kumar aRY@ aryaanil...@gmail.comwrote:

 Write a program that reads a contents of webpages?

 --
 *Anil Kumar Arya*
 *B.Tech 2nd Year*
 *Motilal Nehru National Institute of Technology,*
 *Allahabad*
 *211004*
 *Email id:-**aryaanil...@gmail.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 this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Thank You
 Rajeev Kumar

 --
 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.




-- 
*Anil Kumar Arya*
*B.Tech 2nd Year*
*Motilal Nehru National Institute of Technology,*
*Allahabad*
*211004*
*Email id:-**aryaanil...@gmail.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 this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] no. of passwords

2011-02-09 Thread snehal jain
how many passwords can be made if
1. there should be atleast 3 capital letters
2. atleast 3 small letters
3. atleast 2 numbers 0-9
4 the password should has length=10

-- 
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] no. of passwords

2011-02-09 Thread sunny agrawal
is it
26C3 * 26C3 * 10C2 * 62C2 * 10!

On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
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: Meetings puzzle

2011-02-09 Thread Tushar Bindal
what are f1, f2, f3,...?

On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote:

 Input: n meetings
 A meeting e(i) has start time s(i) and finish time f(i).
 Sort n events based on there finish time f(i)
 Say sorted meeting(based on finishing time) are:
 e1,e2,e3,e4,...en

 E(t): denotes the maximum no of meetings conducted where 0 = time = t.

 E(f1) = e1
 E(f2) = max(E(s2) + 1), E(f1));
 E(f3) = max(E(s3)+1), E(f2));

 Make array of E based on finishing times.
 So your array will have values of E at different finishing times
 f1 E1
 f2, E2
 f3 E3
 f4 E4

 so E2 means maximum no of events between time = f2 and  f3.

 Hope it is now clear.


 On Wed, Feb 9, 2011 at 12:59 PM, Sachin Agarwal sachinagarwa...@gmail.com
  wrote:

 didn't quite get it, can you please elaborate.
 thanks

 On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com wrote:
  Use dynamic programming:
  1) Sort the events in order of finishing time.
  f1, f2, f3, f4, ... fn
 
  E(fn) = E(sn) + 1;
  Solve the above recursion
  sn is start time of event n
 
  On Wed, Feb 9, 2011 at 11:30 AM, Sachin Agarwal
  sachinagarwa...@gmail.comwrote:
 
 
 
 
 
 
 
   Suppose I have a room and I want to schedule meetings in it. You're
   given a list of meeting start and end times. Find a way to schedule
   the maximum number of meetings in the room.
 
   --
   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.




-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] no. of passwords

2011-02-09 Thread Tushar Bindal
Are all the selected letters or numbers always different?
If they can also be same then answer would be different.

On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 is it
 26C3 * 26C3 * 10C2 * 62C2 * 10!


 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar
sorry.
did not go thru it thoroughly earlier.
got it now.

On Feb 9, 7:35 pm, Tushar Bindal tushicom...@gmail.com wrote:
 what are f1, f2, f3,...?



 On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote:
  Input: n meetings
  A meeting e(i) has start time s(i) and finish time f(i).
  Sort n events based on there finish time f(i)
  Say sorted meeting(based on finishing time) are:
  e1,e2,e3,e4,...en

  E(t): denotes the maximum no of meetings conducted where 0 = time = t.

  E(f1) = e1
  E(f2) = max(E(s2) + 1), E(f1));
  E(f3) = max(E(s3)+1), E(f2));

  Make array of E based on finishing times.
  So your array will have values of E at different finishing times
  f1 E1
  f2, E2
  f3 E3
  f4 E4

  so E2 means maximum no of events between time = f2 and  f3.

  Hope it is now clear.

  On Wed, Feb 9, 2011 at 12:59 PM, Sachin Agarwal sachinagarwa...@gmail.com
   wrote:

  didn't quite get it, can you please elaborate.
  thanks

  On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com wrote:
   Use dynamic programming:
   1) Sort the events in order of finishing time.
   f1, f2, f3, f4, ... fn

   E(fn) = E(sn) + 1;
   Solve the above recursion
   sn is start time of event n

   On Wed, Feb 9, 2011 at 11:30 AM, Sachin Agarwal
   sachinagarwa...@gmail.comwrote:

Suppose I have a room and I want to schedule meetings in it. You're
given a list of meeting start and end times. Find a way to schedule
the maximum number of meetings in the room.

--
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.

 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob:+919818442705begin_of_the_skype_highlighting+919818442705  end_of_the_skype_highlighting
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] MINIMUM POSITIVE SUM

2011-02-09 Thread Manish Verma
Given: An array of integers(may be both positive and negative), we
have to find out the  minimum positive sum of array(not necessarily
continuous).

example:-  {1,-5,7,10,-14,16,-17,20,21,22}

here answer is -5,-17,22 having sum=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.



[algogeeks] MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
Given: An array of integers(may be both positive and negative), we
have to find out the  minimum positive sum of array(not necessarily
continuous).

example:-  {1,-5,7,10,-14,16,-17,20,21,22}

here answer is -5,-17,22 having sum=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] no. of passwords

2011-02-09 Thread snehal jain
letters and no. can be same... so the ans shd be different

On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal tushicom...@gmail.com wrote:

 Are all the selected letters or numbers always different?
 If they can also be same then answer would be different.


 On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 is it
 26C3 * 26C3 * 10C2 * 62C2 * 10!


 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.comwrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 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: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@jalaj: text missing.??? I think i've mentioned question
properly.is there any thing more u require?

n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
 @monsieur ... text missing dude



 On Wed, Feb 9, 2011 at 10:12 PM, MONSIEUR monsieur@gmail.com wrote:
  Given: An array of integers(may be both positive and negative), we
  have to find out the  minimum positive sum of array(not necessarily
  continuous).

  example:-  {1,-5,7,10,-14,16,-17,20,21,22}

         here answer is -5,-17,22 having sum=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
 Final Year Undergraduate,
 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.



Re: [algogeeks] no. of passwords

2011-02-09 Thread sunny agrawal
yes they can be same, forgot to consider that
so it should be
(26^3)*(26^3)*(10^2)*(62^2)*(10!)
??

On Wed, Feb 9, 2011 at 10:20 PM, snehal jain learner@gmail.com wrote:

 letters and no. can be same... so the ans shd be different


 On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal tushicom...@gmail.comwrote:

 Are all the selected letters or numbers always different?
 If they can also be same then answer would be different.


 On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 is it
 26C3 * 26C3 * 10C2 * 62C2 * 10!


 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.comwrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 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.




-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
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: MINIMUM POSITIVE SUM

2011-02-09 Thread Rel Guzman Apaza
I think the only solution will be finding all subsets.

2011/2/9 MONSIEUR monsieur@gmail.com

 @jalaj: text missing.??? I think i've mentioned question
 properly.is there any thing more u require?

 n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
  @monsieur ... text missing dude
 
 
 
  On Wed, Feb 9, 2011 at 10:12 PM, MONSIEUR monsieur@gmail.com
 wrote:
   Given: An array of integers(may be both positive and negative), we
   have to find out the  minimum positive sum of array(not necessarily
   continuous).
 
   example:-  {1,-5,7,10,-14,16,-17,20,21,22}
 
  here answer is -5,-17,22 having sum=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
  Final Year Undergraduate,
  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.



Re: [algogeeks] m-permutation

2011-02-09 Thread Rel Guzman Apaza
maybe using a circular linked list.

2011/2/9 punnu punnu.gino...@gmail.com

 Suppose n people are arranged in a circle. Number the people from 1 to
 n. in the clockwise order. We are given an integer ,m = n. Beginning
 with the person with designated number 1, we proceed around the circle
 (in clockwise order) removing every mth person. After each person is
 removed, counting continues around the circle that
 remains. This process continues until all the n people have been
 removed. . The .m-permutation is defined as the order in which the
 people have been removed. As an example, if n = 7, m = 3, then the 3 -
 permutation is 3,6,2,7,5,1,4.
 Give an O(n log n) time algorithm which given m and n outputs the m-
 permutation.

 --
 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] no. of passwords

2011-02-09 Thread snehal jain
@sunny

i think even this wont work

multiplying by 10! is wrong as when we have selecting same letters or
numbers then permutions will be fewer than 10!..
correct me if i am wrong..

On Wed, Feb 9, 2011 at 10:33 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 yes they can be same, forgot to consider that
 so it should be
 (26^3)*(26^3)*(10^2)*(62^2)*(10!)
 ??

 On Wed, Feb 9, 2011 at 10:20 PM, snehal jain learner@gmail.comwrote:

 letters and no. can be same... so the ans shd be different


 On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal tushicom...@gmail.comwrote:

 Are all the selected letters or numbers always different?
 If they can also be same then answer would be different.


 On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal 
 sunny816.i...@gmail.comwrote:

 is it
 26C3 * 26C3 * 10C2 * 62C2 * 10!


 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.comwrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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] no. of passwords

2011-02-09 Thread sunny agrawal
right, it will also not work

On Wed, Feb 9, 2011 at 10:42 PM, snehal jain learner@gmail.com wrote:

 @sunny

 i think even this wont work

 multiplying by 10! is wrong as when we have selecting same letters or
 numbers then permutions will be fewer than 10!..
 correct me if i am wrong..


 On Wed, Feb 9, 2011 at 10:33 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 yes they can be same, forgot to consider that
 so it should be
 (26^3)*(26^3)*(10^2)*(62^2)*(10!)
 ??

 On Wed, Feb 9, 2011 at 10:20 PM, snehal jain learner@gmail.comwrote:

 letters and no. can be same... so the ans shd be different


 On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal tushicom...@gmail.comwrote:

 Are all the selected letters or numbers always different?
 If they can also be same then answer would be different.


 On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal 
 sunny816.i...@gmail.comwrote:

 is it
 26C3 * 26C3 * 10C2 * 62C2 * 10!


 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.comwrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.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 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.




 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

-- 
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: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@apaza: brute force.checking all combinations(with at least one
negative number,if any)..too hard buddy.

On Feb 9, 10:07 pm, Rel Guzman Apaza rgap...@gmail.com wrote:
 I think the only solution will be finding all subsets.

 2011/2/9 MONSIEUR monsieur@gmail.com

  @jalaj: text missing.??? I think i've mentioned question
  properly.is there any thing more u require?

  n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
   @monsieur ... text missing dude

   On Wed, Feb 9, 2011 at 10:12 PM, MONSIEUR monsieur@gmail.com
  wrote:
Given: An array of integers(may be both positive and negative), we
have to find out the  minimum positive sum of array(not necessarily
continuous).

example:-  {1,-5,7,10,-14,16,-17,20,21,22}

       here answer is -5,-17,22 having sum=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
   Final Year Undergraduate,
   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.



Re: [algogeeks] CODECHEF FLIP COIN problem

2011-02-09 Thread Arpit Sood
you are not actually using the concept of lazy propagation in the code, you
are doing update in O(n). if you want the solution then reply back.

On Wed, Feb 9, 2011 at 6:22 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 @arpit : could you please tell me what is the problem with the update
 function ??

 On Wed, Feb 9, 2011 at 3:32 PM, Arpit Sood soodfi...@gmail.com wrote:

 there is problem with the update function...

 On Tue, Feb 8, 2011 at 8:14 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 Hey thanks for your help
 I have written a code using range trees but I am still getting TLE [?][?]
 [?]
 Please suggest me something


 Here is my code

 /*
  * File:   main1.c
  * Author: gs
  *
  * Created on 8 February, 2011, 7:46 PM
  */

 #include stdio.h
 #include stdlib.h


 #define MAX 30
 #define loop0(i,j) for(int i=0;ij;i++)
 #define loop1(i,j) for(int i=1;ij;i++)
 # define true 1
 # define false 0


 _Bool flag[MAX];
 int value[MAX];

 /*void initialize(int node, int b, int e)
 {
 if (b == e)
 {
 flag[node] = false;
 value[node] = 0;
 }
 else
 {
 initialize(2 * node, b, (b + e) / 2);
 initialize(2 * node + 1, (b + e) / 2 + 1, e);
 value[node] = 0;
 flag[node] = false;
 }
 }*/

 int update(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if(b==e)
 {
 if(flag[node] == true)
 return 1;
 else
 return 0;
 }
 if (b = i  e = j)
 {
 if(flag[node] == true)
 {
 flag[node] = false;
 flag[2*node] = !flag[2*node];
 flag[2*node+1] = !flag[2*node+1];
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return (value[node] = p1 + p2);
 }
 else
 return value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return value[node] = p1 + p2;
 }
 }

 int query(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if (b = i  e = j)
 {
 flag[node] = !flag[node];
 return value[node] = e - b + 1 - value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = query(2 * node, b, (b + e) / 2, i, j);
 p2 = query(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 if(p1==-1)
 p1=0;
 if(p2==-1)
 p2=0;
 return (value[node] = p1 + p2);
 }
 }

 int main()
 {
int i, n, q,ret;
int cmd, a, b, z;
scanf(%d %d,n,q);
//initialize(1, 0, tests-1);
for(i=0;i q;i++)
{
scanf(%d %d %d,cmd,a,b);
if(cmd==0)
value[1] = query(1,0,n-1,a,b);
else
printf(%d\n,update(1,0,n-1,a,b));
}
return 0;

 }




 On Tue, Feb 8, 2011 at 3:41 PM, sunny agrawal 
 sunny816.i...@gmail.comwrote:

 make a tree where each node have the following structure

 1. rangeLow
 2. rangeHigh
 3. headCount of its complete subTree
 4. boolean variable change, if true means all nodes of that subtree need
 to be flipped but we are not flipping in the hope if again a flip occur we
 can reset the flag and we can save some time
 5.isHead

 initialise range tree as for root range 0-MAX
 leftSubTree 0-MAX/2 rightSubTree MAX/2+1 - MAX
 all headCount initially 0
 all changes to false

 as a query comes, if it matches with range of some node we can stop
 propagating at that level and making change true so no need to go till leaf
 nodes
 new head count at that node will be (total nodes in its range - prev
 headCount)


 if you are still not able to get it you should read a range tree
 tutorial, that will really help

 On Tue, Feb 8, 2011 at 2:28 PM, Gaurav Saxena 
 grvsaxena...@gmail.comwrote:

 Actually I could not figure out any good way of doing this . [?][?]
 Could you please suggest me something or give some idea .
 Thanks for helping

 On Tue, Feb 8, 2011 at 1:51 PM, sunny agrawal sunny816.i...@gmail.com
  wrote:

 i think time complexity of the O(nlgn) for an avg case will suffice

 no it will not be inefficient if we keep sufficient information at
 each node
 each node will keep information of all its childs(headCount) and using
 some optimizations such as if two flips on same range occur 
 simultaneously,
 then after all there will be no effect at all so there was no need of 
 doing
 anything.

 On Tue, Feb 8, 2011 at 1:27 PM, Gaurav Saxena grvsaxena...@gmail.com
  

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@sunny: actually it is not like maximum positive sum.it is
necessary to select at least one number.The only constraint is MINIMUM
POSITIVE SUM , If all numbers are negative then print simply no
positive sum exist.
example:  {-300,98,-230}
   answer: 98

On Feb 9, 10:23 pm, sunny agrawal sunny816.i...@gmail.com wrote:
 in this question is it necessary to select atleast one element, else minimum
 positive sum will be 0 for each case, by selecting zero numbers as this
 question seems to be same as maximum positive sum in which if all elements
 are negative, ans is zero that is by selecting zero no of elements ??

 On Wed, Feb 9, 2011 at 10:37 PM, Rel Guzman Apaza rgap...@gmail.com wrote:



  I think the only solution will be finding all subsets.

  2011/2/9 MONSIEUR monsieur@gmail.com

  @jalaj: text missing.??? I think i've mentioned question
  properly.is there any thing more u require?

  n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
   @monsieur ... text missing dude

   On Wed, Feb 9, 2011 at 10:12 PM, MONSIEUR monsieur@gmail.com
  wrote:
Given: An array of integers(may be both positive and negative), we
have to find out the  minimum positive sum of array(not necessarily
continuous).

example:-  {1,-5,7,10,-14,16,-17,20,21,22}

       here answer is -5,-17,22 having sum=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
   Final Year Undergraduate,
   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.

 --
 Sunny Aggrawal
 B-Tech IV year,CSI
 Indian Institute Of Technology,Roorkee

-- 
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] CODECHEF FLIP COIN problem

2011-02-09 Thread Gaurav Saxena
Yes actually I could not figure out how to implement that lazy propagation
in the array . Yes please help me in doing that.


On Wed, Feb 9, 2011 at 10:56 PM, Arpit Sood soodfi...@gmail.com wrote:

 you are not actually using the concept of lazy propagation in the code, you
 are doing update in O(n). if you want the solution then reply back.


 On Wed, Feb 9, 2011 at 6:22 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 @arpit : could you please tell me what is the problem with the update
 function ??

 On Wed, Feb 9, 2011 at 3:32 PM, Arpit Sood soodfi...@gmail.com wrote:

 there is problem with the update function...

 On Tue, Feb 8, 2011 at 8:14 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:

 Hey thanks for your help
 I have written a code using range trees but I am still getting TLE [?][?]
 [?]
 Please suggest me something


 Here is my code

 /*
  * File:   main1.c
  * Author: gs
  *
  * Created on 8 February, 2011, 7:46 PM
  */

 #include stdio.h
 #include stdlib.h


 #define MAX 30
 #define loop0(i,j) for(int i=0;ij;i++)
 #define loop1(i,j) for(int i=1;ij;i++)
 # define true 1
 # define false 0


 _Bool flag[MAX];
 int value[MAX];

 /*void initialize(int node, int b, int e)
 {
 if (b == e)
 {
 flag[node] = false;
 value[node] = 0;
 }
 else
 {
 initialize(2 * node, b, (b + e) / 2);
 initialize(2 * node + 1, (b + e) / 2 + 1, e);
 value[node] = 0;
 flag[node] = false;
 }
 }*/

 int update(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if(b==e)
 {
 if(flag[node] == true)
 return 1;
 else
 return 0;
 }
 if (b = i  e = j)
 {
 if(flag[node] == true)
 {
 flag[node] = false;
 flag[2*node] = !flag[2*node];
 flag[2*node+1] = !flag[2*node+1];
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return (value[node] = p1 + p2);
 }
 else
 return value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = update(2 * node, b, (b + e) / 2, i, j);
 p2 = update(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 return value[node] = p1 + p2;
 }
 }

 int query(int node, int b, int e, int i, int j)
 {
 int p1, p2;
 if (i  e || j  b)
 return 0;
 if (b = i  e = j)
 {
 flag[node] = !flag[node];
 return value[node] = e - b + 1 - value[node];
 }
 else
 {
 if(flag[node]==true)
 {
 flag[node]=false;
 flag[2*node]=!flag[2*node];
 flag[2*node+1]=!flag[2*node+1];
 }
 p1 = query(2 * node, b, (b + e) / 2, i, j);
 p2 = query(2 * node + 1, (b + e) / 2 + 1, e, i, j);
 if(p1==-1)
 p1=0;
 if(p2==-1)
 p2=0;
 return (value[node] = p1 + p2);
 }
 }

 int main()
 {
int i, n, q,ret;
int cmd, a, b, z;
scanf(%d %d,n,q);
//initialize(1, 0, tests-1);
for(i=0;i q;i++)
{
scanf(%d %d %d,cmd,a,b);
if(cmd==0)
value[1] = query(1,0,n-1,a,b);
else
printf(%d\n,update(1,0,n-1,a,b));
}
return 0;

 }




 On Tue, Feb 8, 2011 at 3:41 PM, sunny agrawal 
 sunny816.i...@gmail.comwrote:

 make a tree where each node have the following structure

 1. rangeLow
 2. rangeHigh
 3. headCount of its complete subTree
 4. boolean variable change, if true means all nodes of that subtree
 need to be flipped but we are not flipping in the hope if again a flip 
 occur
 we can reset the flag and we can save some time
 5.isHead

 initialise range tree as for root range 0-MAX
 leftSubTree 0-MAX/2 rightSubTree MAX/2+1 - MAX
 all headCount initially 0
 all changes to false

 as a query comes, if it matches with range of some node we can stop
 propagating at that level and making change true so no need to go till 
 leaf
 nodes
 new head count at that node will be (total nodes in its range - prev
 headCount)


 if you are still not able to get it you should read a range tree
 tutorial, that will really help

 On Tue, Feb 8, 2011 at 2:28 PM, Gaurav Saxena 
 grvsaxena...@gmail.comwrote:

 Actually I could not figure out any good way of doing this . [?][?]
 Could you please suggest me something or give some idea .
 Thanks for helping

 On Tue, Feb 8, 2011 at 1:51 PM, sunny agrawal 
 sunny816.i...@gmail.com wrote:

 i think time complexity of the O(nlgn) for an avg case will suffice

 no it will not be inefficient if we keep sufficient information at
 each node
 each node will keep information of all its childs(headCount) and
 using some optimizations such as if two 

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread Dave
@Monsieur: Note that 0 is not positive so it doesn't match your stated
solution requirement. Maybe you meant non-negative instead of
positive, or maybe you meant that the answer is 1, having sum=1.

Dave

On Feb 9, 10:42 am, MONSIEUR monsieur@gmail.com wrote:
 Given: An array of integers(may be both positive and negative), we
 have to find out the  minimum positive sum of array(not necessarily
 continuous).

 example:-  {1,-5,7,10,-14,16,-17,20,21,22}

         here answer is -5,-17,22 having sum=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.



[algogeeks] spoj-RENT problem

2011-02-09 Thread keyankarthi
https://www.spoj.pl/problems/RENT/

tried dp for this problem.. getting tle.. classifier says this is
binary search. not able to get how to binary search this problem..
help me out...
thanks..
karthikeyan..

-- 
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] m-permutation

2011-02-09 Thread Jhosimar Arias
This is a josephus problem, using a circular linked list takes cuadratic
time O( m n ), I think the josephus problem can be solved using rank trees
in O(n log n).

Construct a rank tree from an array with n elements storing the elements in
a binary tree in in-order sequence ( Constructor ). Store in each node T the
size of the subtree whose root is T.

We have the following operation for the tree:

1.find(int k) returns the item at rank (index) k.
2.remove(int k) removes the item at rank k.
3.size() returns the current size ( size is the number of elements in the
subtree of a node S)

Find and Remove takes O( log n ) and Constructor takes O( n ).


2011/2/9 Rel Guzman Apaza rgap...@gmail.com

 maybe using a circular linked list.

 2011/2/9 punnu punnu.gino...@gmail.com

 Suppose n people are arranged in a circle. Number the people from 1 to
 n. in the clockwise order. We are given an integer ,m = n. Beginning
 with the person with designated number 1, we proceed around the circle
 (in clockwise order) removing every mth person. After each person is
 removed, counting continues around the circle that
 remains. This process continues until all the n people have been
 removed. . The .m-permutation is defined as the order in which the
 people have been removed. As an example, if n = 7, m = 3, then the 3 -
 permutation is 3,6,2,7,5,1,4.
 Give an O(n log n) time algorithm which given m and n outputs the m-
 permutation.

 --
 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] SUDHIR MISHRA wants to chat

2011-02-09 Thread SUDHIR MISHRA
---

SUDHIR MISHRA 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-62d5befb93-a1202cc5cd-5oEiMcLpaEPVY-UR9eGSSYdrezQ
You'll need to click this link to be able to chat with SUDHIR MISHRA.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with SUDHIR MISHRA, visit:
http://mail.google.com/mail/a-62d5befb93-a1202cc5cd-5oEiMcLpaEPVY-UR9eGSSYdrezQ

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 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: no. of passwords

2011-02-09 Thread Dave
The following combinations of capital letters C, lower case letters
l, and digits d are possible:

C l d  Number possible
3 3 4  10C3 * 26^3 * 7C3 * 26^3 * 4C4 * 10^4
3 4 3  10C3 * 26^3 * 7C4 * 26^4 * 3C3 * 10^3
3 5 2  10C3 * 26^3 * 7C5 * 26^5 * 2C2 * 10^2
4 3 3  10C4 * 26^4 * 6C3 * 26^3 * 3C3 * 10^3
4 4 2  10C4 * 26^4 * 6C4 * 26^4 * 2C2 * 10^2
5 3 2  10C5 * 26^5 * 5C3 * 26^3 * 2C2 * 10^2

Add them up to get the total number of passwords. Plugging the values
of C, l, and d into an Excel spreadsheet and using the COMBIN(n,k)
function for the binomial coefficients gives the total number of
passwords as 251,471,033,958,144,000.


Dave

On Feb 9, 7:46 am, snehal jain learner@gmail.com wrote:
 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

-- 
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] no. of passwords

2011-02-09 Thread Manmeet Singh
@ Dave : I think this shud also give the same result
C(26, 3) * C(26, 3) * C(10, 2) *  C(62, 2)

On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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] no. of passwords

2011-02-09 Thread Manmeet Singh
Also it shud now be multiplied with Factorial of 10

On Thu, Feb 10, 2011 at 1:14 AM, Manmeet Singh mans.aus...@gmail.comwrote:

 @ Dave : I think this shud also give the same result
 C(26, 3) * C(26, 3) * C(10, 2) *  C(62, 2)

 On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote:

 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

 --
 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: no. of passwords

2011-02-09 Thread Dave
No. That is too large, at 2,087,438,895,360,000,000. Analyzing your
expression, 26C3 is the number of ways to choose 3 different letters,
but the letters can be the same. The number of combinations of 3
letters with repetitions is 26^3. So that aspect of your formula is
too small. However, you can't multiply by 10! because when there are
duplicate letters or digits, you will be counting those duplicates
multiple times. E.g., under your scheme, passwords with 3 As, 3
as, and 4 1s will be counted 10! times when there are only 10! /
(3! * 3! * 4!) = 4,200 distinct combinations.

My expression says, e.g., that there are 10C3 different combinations
of positions within the 10 character password where you can put 3
capital letters and there are 26^3 combinations of the letters. Then,
once you've placed 3 capital letters, there are 7 spaces left, and you
can put the 3 lower case letters in 7C3 different combinations of
those positions, again with 26^3 combinations of letters, and finally,
the four remaining positions contain digits, and there are 10^4
posibilities. Etc.

Dave

On Feb 9, 1:48 pm, Manmeet Singh mans.aus...@gmail.com wrote:
 Also it shud now be multiplied with Factorial of 10

 On Thu, Feb 10, 2011 at 1:14 AM, Manmeet Singh mans.aus...@gmail.comwrote:



  @ Dave : I think this shud also give the same result
  C(26, 3) * C(26, 3) * C(10, 2) *  C(62, 2)

  On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote:

  how many passwords can be made if
  1. there should be atleast 3 capital letters
  2. atleast 3 small letters
  3. atleast 2 numbers 0-9
  4 the password should has length=10

  --
  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.- 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 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] MicroSoft Interview Question-9 February 2011

2011-02-09 Thread Divesh Dixit
1. write a function to convert a decimal no. to Roman no.  (10 marks)
2. Design a elevators system for 50 storied hotel.
  condition are... at least one left should be available on ground
flore. Min. time is expected ot reach the any floore...  (5 marks)
3. Design all the test case for function
String  stringReverse(i am a good boy) --- out put is (boy
good a am i) ;
4. Do the boundary level and partition equivalence testing for the
following specification.
   below 18 years  too young to get insured
   between 18 to 30 both inclusive get insured with 20% Discount.
   above 30 get insured.
5.  output
   a = 10;
   b=a+++a;
   what is a and b ?   a = 11 and b=20
6. foo(int x)
   {   if(x0)
  foo(--x);
   printf(%d,x);
   }
  int main()
   { foo(5);
   }
output = 0,0,1,2,3,4,5
7. char m[16]=MicroSoft;
 a = 2 ; will the folloing code will compile if yes then output?
Printf(%d%d,(a+3)m,m(2)) some thing like but the answer was
sf
8. one network objective quetion.. which layer is responsible for the
reliable delivery of packets..
Transport Layer
9. one mathematical quetion on realibilty is 90% and MTTF(mean time to
failure) = 200 days. if
   it would be 95%. and 5 day for repair.. then what MTTF
   {a.200 b.205 c. 500 d.700 }
10. Output of Sql query
 Translate((Replace(Ltrim(Rtrim($$JUNK##),#),
$)JU,**),*,'trouble');

-- 
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: no. of passwords

2011-02-09 Thread SVIX
1. there should be atleast 3 capital letters
2. atleast 3 small letters

- 6 spaces gone for these, with repetitions allowed.

for 3 spaces, we have 26^3 possibilities, and they can be arranged in
10C3 ways...

for the next 3, they can be arranged in 7C3 ways

3. atleast 2 numbers 0-9

now, 4 spaces left, 10 digits, 100 combinations.. 4C2 ways

4. the password should has length=10

remaining 2 spaces. assuming only caps, small and numbers, we have
(26+26+10)^2 combinations.

On Feb 9, 5:46 am, snehal jain learner@gmail.com wrote:
 how many passwords can be made if
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters
 3. atleast 2 numbers 0-9
 4 the password should has length=10

-- 
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: no. of passwords

2011-02-09 Thread Dave
@SVIX: According to my calculation, this gives
2,992,430,052,218,880,000, almost 12 times the correct answer,
251,471,033,958,144,000, that I gave earlier in posting
http://groups.google.com/group/algogeeks/msg/bb2269736a997419. This is
because you are counting some passwords multiple times. Consider, for
example, the set of passwords that have 3 As, 3 as, 2 1s, and 2
additional As for the at large characters. You would say that
there are 10C3 * 7C3 * 4C2 = 25,200 of them. The mistake you are
making is distinguishing between the first 3 As and the last 2,
whereas they actually are indistinguishable.  In actuality, there are
10C5 * 5C3 * 2C2 = 2,520 of them.

Dave

On Feb 9, 10:38 pm, SVIX saivivekh.swaminat...@gmail.com wrote:
 1. there should be atleast 3 capital letters
 2. atleast 3 small letters

 - 6 spaces gone for these, with repetitions allowed.

 for 3 spaces, we have 26^3 possibilities, and they can be arranged in
 10C3 ways...

 for the next 3, they can be arranged in 7C3 ways

 3. atleast 2 numbers 0-9

 now, 4 spaces left, 10 digits, 100 combinations.. 4C2 ways

 4. the password should has length=10

 remaining 2 spaces. assuming only caps, small and numbers, we have
 (26+26+10)^2 combinations.

 On Feb 9, 5:46 am, snehal jain learner@gmail.com wrote:



  how many passwords can be made if
  1. there should be atleast 3 capital letters
  2. atleast 3 small letters
  3. atleast 2 numbers 0-9
  4 the password should has length=10- 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 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: no. of passwords

2011-02-09 Thread SVIX
ah... I see what you're saying...

On Feb 9, 8:56 pm, Dave dave_and_da...@juno.com wrote:
 @SVIX: According to my calculation, this gives
 2,992,430,052,218,880,000, almost 12 times the correct answer,
 251,471,033,958,144,000, that I gave earlier in 
 postinghttp://groups.google.com/group/algogeeks/msg/bb2269736a997419. This is
 because you are counting some passwords multiple times. Consider, for
 example, the set of passwords that have 3 As, 3 as, 2 1s, and 2
 additional As for the at large characters. You would say that
 there are 10C3 * 7C3 * 4C2 = 25,200 of them. The mistake you are
 making is distinguishing between the first 3 As and the last 2,
 whereas they actually are indistinguishable.  In actuality, there are
 10C5 * 5C3 * 2C2 = 2,520 of them.

 Dave

 On Feb 9, 10:38 pm, SVIX saivivekh.swaminat...@gmail.com wrote:







  1. there should be atleast 3 capital letters
  2. atleast 3 small letters

  - 6 spaces gone for these, with repetitions allowed.

  for 3 spaces, we have 26^3 possibilities, and they can be arranged in
  10C3 ways...

  for the next 3, they can be arranged in 7C3 ways

  3. atleast 2 numbers 0-9

  now, 4 spaces left, 10 digits, 100 combinations.. 4C2 ways

  4. the password should has length=10

  remaining 2 spaces. assuming only caps, small and numbers, we have
  (26+26+10)^2 combinations.

  On Feb 9, 5:46 am, snehal jain learner@gmail.com wrote:

   how many passwords can be made if
   1. there should be atleast 3 capital letters
   2. atleast 3 small letters
   3. atleast 2 numbers 0-9
   4 the password should has length=10- 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 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] Call for Papers: The 2011 International Conference on Foundations of Computer Science (FCS'11), USA, July 18-21, 2011

2011-02-09 Thread A. M. G. Solo
   CALL  FOR  PAPERS
 and
  Call For Workshop/Session Proposals
 
    FCS'11
   The 2011 International Conference on Foundations
 of Computer Science
 
   Date and Location: July 18-21, 2011, USA
 
   http://www.world-academy-of-science.org/
   Location: See the above web site for venue/city
 
You are invited to submit a full paper for consideration. All
accepted papers will be published in the FCS conference
proceedings (in printed book form; later, the proceedings will
also be accessible online). Those interested in proposing
workshops/sessions, should refer to the relevant sections that
appear below.
 
 
SCOPE: Topics of interest include, but are not limited to, the following:
 
O  Quantum Computing
O  Game theory and methods
O  Computational number theory
O  Logic in computer science
O  Theory of computing and formal systems
O  Automata and formal languages
O  Optimization methods
O  Coding theory
O  Novel data structures
O  Languages
O  Complexity theory (including circuit complexity)
O  Theory of parallel and distributed computing
O  Graph algorithms and graph drawing
O  Deduction
O  Combinatorics
O  Algorithms
O  Probabilistic and randomized methodologies
O  Approximation methods
O  Parametrized complexity (including Kolmogorov, ...)
O  Non-linear dynamics and chaos
O  Computational biology and bioinformatics
O  Cryptography
O  Novel compression methods
O  Database theory
O  Queuing methods
O  Pansystems
O  Foundations of computer security
O  Model checking and computer-aided verification
O  Models of computation
O  Computational geometry
O  Semantics, concurrency and type theory
O  Scheduling methods
O  Models of internet computing
O  Other emerging topics
 
 
USEFUL WEB LINKS:
To see the DBLP list of accepted papers of FCS 2009, go to:
http://www.informatik.uni-trier.de/~ley/db/conf/fcs/fcs2009.html
The DBLP list of accepted papers of FCS 2010 will soon appear at:
http://www.informatik.uni-trier.de/~ley/db/conf/fcs/fcs2010.html
FCS 2011 URL: 
http://www.world-academy-of-science.org/worldcomp11/ws/conferences/fcs11
 
 
IMPORTANT DATES:
 
March 10, 2011:    Submission of papers (about 5 to 7 pages)
April 03, 2011:    Notification of acceptance (+/- two days)
April 24, 2011:    Final papers + Copyright/Consent + Registration
July 18-21, 2011:  The 2011 International Conference on Foundations
   of Computer Science (FCS'11)
 
 
ACADEMIC CO-SPONSORS:
 
Currently being prepared - The Academic sponsors of the last offering
of FCS (2010) included research labs and centers affiliated
with (a partial list): University of California, Berkeley; University
of Southern California; University of Texas at Austin; Harvard
University, Cambridge, Massachusetts; Georgia Institute of Technology,
Georgia; Emory University, Georgia; University of Minnesota;
University of Iowa; University of North Dakota; NDSU-CIIT Green
Computing  Comm. Lab.; University of Siegen, Germany; UMIT, Austria;
SECLAB (University of Naples Federico II + University of Naples
Parthenope + Second University of Naples, Italy); National Institute
for Health Research; World Academy of Biomedical Sciences and
Technologies; Russian Academy of Sciences, Russia; International
Society of Intelligent Biological Medicine (ISIBM); The International
Council on Medical and Care Compunetics; Eastern Virginia Medical
School  the American College of Surgeons, USA.
 
 
SUBMISSION OF PAPERS:
 
Prospective authors are invited to submit their papers by uploading
them to the evaluation web site at:  http://world-comp.org
Submissions must be uploaded by March 10, 2011 and they must be
in either MS doc (but not docx) or pdf formats (about 5 to 7
pages - single space, font size of 10 to 12). All reasonable
typesetting formats are acceptable (later, the authors of accepted
papers will be asked to follow a particular typesetting format to
prepare their final papers for publication.) Papers must not have
been previously published or currently submitted for publication
elsewhere.
The first page of the paper should include: title of the paper,
name, affiliation, postal address, and email address for each
author. The first page should also identify the name of the Contact
Author and a maximum of 5 topical keywords that would best
represent the content of the paper. Finally, the name of the
conference (ie, FCS) that the paper is being submitted for
consideration must be stated on the first page.
 
The length of the final/Camera-Ready papers (if accepted) will be
limited to 7 (two-column IEEE style) pages.
 
Each paper will be peer-reviewed by two experts in the field for
originality, significance, clarity, impact, and soundness. In cases
of contradictory recommendations, a member of the conference
program committee will be charged to make the final decision
(accept/reject) - often, this would involve seeking help from
additional 

[algogeeks] array problem

2011-02-09 Thread jalaj jaiswal
sort the input array. only following operations on array is allowed:
1)get(index) -gets the element at that index
2)reverse(int start,int end) - example reverse(1,3) for the array
[1,2,3,4,5] will return [1,4,3,2,5]

better then nlogn

-- 
With Regards,
*Jalaj Jaiswal* (+919019947895)
Software developer, Cisco Systems
Final Year Undergraduate,
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.



[algogeeks] Call for Papers - Technospeak (Part of Sankalan 2011): Department of Computer Science, University of Delhi

2011-02-09 Thread Sankalan DUCSS
Hi!

The Department of Computer Science, University of Delhi is organising
its annual technical fest - Sankalan 2011 on 5th and 6th of March,
2011. The fest consists of technical as well as non technical events.
Kindly refer to http://cs.du.ac.in/sankalan2011

A technical paper presentation event - Technospeak is part of
Sankalan. This is a call for submission of papers for the event. The
papers can either be self-authored or published papers can be chosen
to be presented.

Total Number of Rounds : 2
Number of participants in a team : Maximum 2

* Round 1

  The participants have to submit a copy of the research paper
along with a self-written overview (1500-1700 words) along with the
following information:

* Names of both participants
* Contact Information (Phone numbers and email addresses)
* Team Name

  Last date of submission : 18th February 2011.
  Results will be announced by : 26th February 2011.
  Selection Criteria : Topic, content and future scope of the
paper.

* Round 2

  8 teams will be selected for final presentation.

* Time Limit : 8-10 minutes.
* Q/A session : 5 minutes.

Kindly email your entries to technospeak2...@gmail.com, with subject
as Techno Speak Registration.

Thanks,

Team Sankalan

-- 
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.