Re: [algogeeks] Opening @ Microsoft Hyd

2015-06-11 Thread ~*~VICKY~*~
Yes, please forward me your resume .

On Thu, Jun 11, 2015 at 3:20 PM, Abhijeet Srivastva 
nwaab.abhij...@gmail.com wrote:

 Hi Venkat,
 I have total 7 years of work experience in core development and currently
 working in one of the top Product development company.
 Please let me know how can i apply for the position.

 Regards,
 Abhijeet Srivastava
 0987114705

 On Sat, Jun 6, 2015 at 12:40 PM, ~*~VICKY~*~ venkat.jun...@gmail.com
 wrote:

 Hi,

 Only to folks in Bangalore

 My team is expanding and is looking for strong devs with deep
 understanding of basics and problem solving skills. The openings are in
 Hyderabad for which will be doing a walk-in interview in Bangalore over
 third week of this month.  If you think you can take up the challenge of
 redesigning and optimizing the cloud computing world, send me your resumes
 (preferably one page resume) to give a shot at this great opportunity.

 PS : No freshers please, Minimum experience of 2 years preferably.
 --
 Cheers,

   Vicky

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to algogeeks+unsubscr...@googlegroups.com.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to algogeeks+unsubscr...@googlegroups.com.




-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


[algogeeks] Opening @ Microsoft Hyd

2015-06-06 Thread ~*~VICKY~*~
Hi,

Only to folks in Bangalore

My team is expanding and is looking for strong devs with deep understanding
of basics and problem solving skills. The openings are in Hyderabad for
which will be doing a walk-in interview in Bangalore over third week of
this month.  If you think you can take up the challenge of redesigning and
optimizing the cloud computing world, send me your resumes (preferably one
page resume) to give a shot at this great opportunity.

PS : No freshers please, Minimum experience of 2 years preferably.
-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


[algogeeks] Opening in Microsoft India Development center, hyderabad.

2015-01-31 Thread ~*~VICKY~*~
Hi folks,

My team is expanding and looking for strong devs with deep understanding of
basics. If you think you can take up the challenge of redesigning and
optimizing the cloud computing world, send me your resumes (preferably one
page resume) to give a shot at this great opportunity.

Some links about the team
http://www.microsoft.com/about/technicalrecognition/Autopilot.aspx
http://www.theregister.co.uk/2014/02/07/microsoft_autopilot_feature/

-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


[algogeeks] Re: Opening in Microsoft India Development center, hyderabad.

2015-01-31 Thread ~*~VICKY~*~
Missed to add, preferably 1 year+ experience.

On Sat, Jan 31, 2015 at 3:26 PM, ~*~VICKY~*~ venkat.jun...@gmail.com
wrote:

 Hi folks,

 My team is expanding and looking for strong devs with deep understanding
 of basics. If you think you can take up the challenge of redesigning and
 optimizing the cloud computing world, send me your resumes (preferably one
 page resume) to give a shot at this great opportunity.

 Some links about the team
 http://www.microsoft.com/about/technicalrecognition/Autopilot.aspx
 http://www.theregister.co.uk/2014/02/07/microsoft_autopilot_feature/

 --
 Cheers,

   Vicky




-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Re: [algogeeks] Regex tester

2012-12-27 Thread ~*~VICKY~*~
I'm giving you a simple recursive code which i wrote long back. Please let
me know if it fails for any cases. Ignore the funny cout's It used to help
me debug and i'm lazy to remove it. :P :)

#includeiostream
#includestring
using namespace std;
/*
abasjc a*c
while(pattern[j] == '*' text[i] == pattern[j]) {i++; j++}
*/
bool match(string text, string pattern, int x, int y)
{
if(pattern.length() == y)
{
couthey\n;
return 1;
}
if(text.length() == x)
{
coutshit\n;
return 0;
}
if(pattern[y] == '.' || text[x] == pattern[y])
{
coutin matchendl;
return match(text,pattern,x+1,y+1);
}
if(pattern[y] == '*')
return match(text,pattern,x+1,y) || match(text,pattern,x+1,y+1) ||
match(text,pattern,x,y+1);

if(text[x] != pattern[y])
{
coutshit1\n;
 return 0;
}

}

int main()
{
string text,pattern;
cin  text  pattern;
cout  match(text, pattern,0, 0);
}

On Thu, Dec 27, 2012 at 6:10 PM, shady sinv...@gmail.com wrote:

 Thanks for the link Ritesh,
 if (isMatch(s, p+2)) return true;
 isnt this line incorrect in the code, as it can lead to segmentation
 fault... how can we directly access p+2 element, we know for sure that p is
 not '\0', but p+1 element can be '\0' , therefore leading to p+2 to be
 undefined.

 On Thu, Dec 27, 2012 at 6:23 AM, Ritesh Mishra rforr...@gmail.com wrote:

 try to solve it by recursion ..
 http://www.leetcode.com/2011/09/regular-expression-matching.html


  Regards,

 Ritesh Kumar Mishra
 Information Technology
 Third Year Undergraduate
 MNNIT Allahabad


 On Sun, Dec 23, 2012 at 11:14 PM, Prem Krishna Chettri 
 hprem...@gmail.com wrote:

 Well I can tell you Something about design pattern to  solve this case..

What I mean is by using The State Machine Design Pattern, Anyone
 can solve this. but Ofcourse it is complicated.




 On Sun, Dec 23, 2012 at 11:01 PM, shady sinv...@gmail.com wrote:

 that's the point, Have to implement it from scratch... otherwise java
 has regex and matcher, pattern to solve it...


 On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh saurab...@gmail.comwrote:

 If you need to implement this for some project then python and java
 have a very nice library


 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT
 blog:geekinessthecoolway.blogspot.com


 On Sun, Dec 23, 2012 at 7:48 PM, shady sinv...@gmail.com wrote:


 http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters

 any solution for this. we need to implement such regex
 tester

 some complex cases :
 *string** regex *   -   * status*
 *
 *
 reesd   re*.d  -   match
 re*eed reeed -   match

 can some one help with this ?

  --




  --




  --




  --




  --




  --






-- 
Cheers,

  Vicky

-- 




[algogeeks] Facebook phone interview questions

2012-10-05 Thread ~*~VICKY~*~
Hi guys pls share the quest you know that was asked in facebook phone
interview. Thank you.

-- 
Cheers,

  Vicky

-- 
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] Design an OO representation to model HTML.

2012-10-01 Thread ~*~VICKY~*~
Could someone throw some light on this OOPS question. I detailed
explanation would be of immense help.

Design an OO representation to model HTML.
How do they represent tags and content? What about containment
relationships? Bonus points if they know that this has already been done a
bunch of times, e.g. with DOM. But they still have to describe it.


-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-14 Thread ~*~VICKY~*~
Hey I just gave an idea, I believe solve it yourself :) I appreciate your
effort.

On Tue, Aug 14, 2012 at 4:34 PM, Kailash Bagaria kbkailashbaga...@gmail.com
 wrote:

 @vicky
 your approach doesn't work for  (x1,y1) = (1,2)
   (x2,y2) = (2,3)

 By your Approach:-
   Ans= sumArray[x2][y2] - sumArray[x1][y1] +
 ip[x1][y1]=66-18+6=*54*
 But Actual Ans is 6+7+10+11=*34*

 On Sun, Aug 12, 2012 at 8:19 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Lets build the array for the example you gave.

 i/p:

 0 1 2 3
 4 5  6 7
 8 9 10 11

 (x1,y1) = (0,0)
 (x2,y2) = (1,2)
 sumArray
 0  1 23
 4  10  18   28
 12 27  45  66
 (will take O(n^2) to build above array)
 So now when you get coordinates as input, you can calc the sum by

 Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

 For our case it will be Ans = 18-0+0 = 18

 Please lemme know if any bugs with the logic.


 On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath 
 srisam261...@gmail.com wrote:


 @ Vicky

 Can yo explain with an illustration ?


 On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 May be you can consider creating a 2d array to pre process and store
 all the rectangle sums as a dependent subproblem, the sum of larger rect
 will be currValuesAdded+OldRectSum. So when you get the coordinate as input
 u can calc the needed sum by subtracting sum of big rect and small rect
 which is not included in the given coordinates. This can be called constant
 time if u don't include the preprocessing time.


 On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar algog...@gmail.comwrote:

 Sum of the integers meaning? Do you mind giving an example test case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.comwrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix
 of integers. yo should find the sum of the integers that fall in the 
 region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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




 --

 --

 ‘Kailash Bagaria’
 B-tech 4th year
 Computer Science  Engineering
 Indian Institute of Technology, Roorkee
 Roorkee, India (247667)

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




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-13 Thread ~*~VICKY~*~
Its something which is good to have discussion with the interviewer rather
than making any assumption. :)

On Mon, Aug 13, 2012 at 6:07 PM, Srividhya Sampath
srisam261...@gmail.comwrote:

 @vicky

 Got it . thanks ..is it possible to ignore the preprocessing time when
 calculating time complexity?



 On Sun, Aug 12, 2012 at 10:02 PM, shady sinv...@gmail.com wrote:

 @venkat +1

 On Sun, Aug 12, 2012 at 9:09 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 @Arun: This approach is constant time once the array is build for any
 queries that follows. :) You know sum for all possible rectangles in the
 given 2d array thats makes it better than computing sum for each input.
 Hope it makes sense


 On Sun, Aug 12, 2012 at 9:07 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Fine, the basic idea of using dp here is sum of each rectangle is a
 dependent sub problem. So when u find sum for smaller rectangle we can use
 it to compute sum of bigger rectangle with new coordinates added to
 previous small rectangle. So u can compute the sum array by using this
 formula

 sum[i][j] = sum[i-1][j-1] + (sum[i-1][j] - sum[i-1][j-1]) +
 (sum[i][j-1] - sum[i-1][j-1])+ip[i][j]
 [smaller rect]   [that row sum value][that
 col sum value]



 On Sun, Aug 12, 2012 at 8:54 PM, Srividhya Sampath 
 srisam261...@gmail.com wrote:

 @vicky

 can yo explain the logic behind the 'Sum Array' computation (if
 possible elaborately )?


 On Sun, Aug 12, 2012 at 8:19 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 Lets build the array for the example you gave.

 i/p:

 0 1 2 3
 4 5  6 7
 8 9 10 11

 (x1,y1) = (0,0)
 (x2,y2) = (1,2)
 sumArray
 0  1 23
 4  10  18   28
 12 27  45  66
 (will take O(n^2) to build above array)
 So now when you get coordinates as input, you can calc the sum by

 Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

 For our case it will be Ans = 18-0+0 = 18

 Please lemme know if any bugs with the logic.


 On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath 
 srisam261...@gmail.com wrote:


 @ Vicky

 Can yo explain with an illustration ?


 On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.com wrote:

 May be you can consider creating a 2d array to pre process and
 store all the rectangle sums as a dependent subproblem, the sum of 
 larger
 rect will be currValuesAdded+OldRectSum. So when you get the 
 coordinate as
 input u can calc the needed sum by subtracting sum of big rect and 
 small
 rect which is not included in the given coordinates. This can be called
 constant time if u don't include the preprocessing time.


 On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar 
 algog...@gmail.comwrote:

 Sum of the integers meaning? Do you mind giving an example test
 case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.com
  wrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a
 matrix of integers. yo should find the sum of the integers that fall 
 in the
 region specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the
 Google Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread ~*~VICKY~*~
Always share code using ideone like sites or discuss the algo approach.
Attaching code isn't the best idea is my personal feeling.

Regards,
Vicky

On Sun, Aug 12, 2012 at 12:44 AM, Ankit Singh ask9092516...@gmail.comwrote:

 if i am correctly understand the problem den i hv attchd the solution..


 On Sun, Aug 12, 2012 at 12:40 AM, Ankit Singh ask9092516...@gmail.comwrote:

 is output is depend on no of digits in a number like 123 example for odd
 no of digits and 121224 example for even digits???

 can you make it clear pls??

 On Sat, Aug 11, 2012 at 5:22 PM, payal gupta gpt.pa...@gmail.com wrote:

 Given the start and an ending integer as user input, generate all
 integers with the following property.
 Example : 123 , 1+2 = 3 , valid number
 121224 12+12 = 24 , valid number
 1235 1+2 = 3 , 2+3 = 5 , valid number
 125 1+2 5 , invalid number

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/zeZVnoP0sOEJ.
 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.




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-12 Thread ~*~VICKY~*~
Lets build the array for the example you gave.

i/p:

0 1 2 3
4 5  6 7
8 9 10 11

(x1,y1) = (0,0)
(x2,y2) = (1,2)
sumArray
0  1 23
4  10  18   28
12 27  45  66
(will take O(n^2) to build above array)
So now when you get coordinates as input, you can calc the sum by

Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

For our case it will be Ans = 18-0+0 = 18

Please lemme know if any bugs with the logic.


On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath
srisam261...@gmail.comwrote:


 @ Vicky

 Can yo explain with an illustration ?


 On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 May be you can consider creating a 2d array to pre process and store all
 the rectangle sums as a dependent subproblem, the sum of larger rect will
 be currValuesAdded+OldRectSum. So when you get the coordinate as input u
 can calc the needed sum by subtracting sum of big rect and small rect which
 is not included in the given coordinates. This can be called constant time
 if u don't include the preprocessing time.


 On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar algog...@gmail.com wrote:

 Sum of the integers meaning? Do you mind giving an example test case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.comwrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix of
 integers. yo should find the sum of the integers that fall in the region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




 --
 Cheers,

   Vicky

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




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-12 Thread ~*~VICKY~*~
@Arun: How do you claim your solution to be constant time? :P

On Sun, Aug 12, 2012 at 8:46 PM, Arun Kindra arunkin...@gmail.com wrote:

 *within

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




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-12 Thread ~*~VICKY~*~
Fine, the basic idea of using dp here is sum of each rectangle is a
dependent sub problem. So when u find sum for smaller rectangle we can use
it to compute sum of bigger rectangle with new coordinates added to
previous small rectangle. So u can compute the sum array by using this
formula

sum[i][j] = sum[i-1][j-1] + (sum[i-1][j] - sum[i-1][j-1]) + (sum[i][j-1] -
sum[i-1][j-1])+ip[i][j]
[smaller rect]   [that row sum value][that col
sum value]



On Sun, Aug 12, 2012 at 8:54 PM, Srividhya Sampath
srisam261...@gmail.comwrote:

 @vicky

 can yo explain the logic behind the 'Sum Array' computation (if possible
 elaborately )?


 On Sun, Aug 12, 2012 at 8:19 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Lets build the array for the example you gave.

 i/p:

 0 1 2 3
 4 5  6 7
 8 9 10 11

 (x1,y1) = (0,0)
 (x2,y2) = (1,2)
 sumArray
 0  1 23
 4  10  18   28
 12 27  45  66
 (will take O(n^2) to build above array)
 So now when you get coordinates as input, you can calc the sum by

 Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

 For our case it will be Ans = 18-0+0 = 18

 Please lemme know if any bugs with the logic.


 On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath 
 srisam261...@gmail.com wrote:


 @ Vicky

 Can yo explain with an illustration ?


 On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 May be you can consider creating a 2d array to pre process and store
 all the rectangle sums as a dependent subproblem, the sum of larger rect
 will be currValuesAdded+OldRectSum. So when you get the coordinate as input
 u can calc the needed sum by subtracting sum of big rect and small rect
 which is not included in the given coordinates. This can be called constant
 time if u don't include the preprocessing time.


 On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar algog...@gmail.comwrote:

 Sum of the integers meaning? Do you mind giving an example test case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.comwrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix
 of integers. yo should find the sum of the integers that fall in the 
 region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-12 Thread ~*~VICKY~*~
@Arun: This approach is constant time once the array is build for any
queries that follows. :) You know sum for all possible rectangles in the
given 2d array thats makes it better than computing sum for each input.
Hope it makes sense

On Sun, Aug 12, 2012 at 9:07 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Fine, the basic idea of using dp here is sum of each rectangle is a
 dependent sub problem. So when u find sum for smaller rectangle we can use
 it to compute sum of bigger rectangle with new coordinates added to
 previous small rectangle. So u can compute the sum array by using this
 formula

 sum[i][j] = sum[i-1][j-1] + (sum[i-1][j] - sum[i-1][j-1]) + (sum[i][j-1] -
 sum[i-1][j-1])+ip[i][j]
 [smaller rect]   [that row sum value][that col
 sum value]



 On Sun, Aug 12, 2012 at 8:54 PM, Srividhya Sampath srisam261...@gmail.com
  wrote:

 @vicky

 can yo explain the logic behind the 'Sum Array' computation (if possible
 elaborately )?


 On Sun, Aug 12, 2012 at 8:19 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Lets build the array for the example you gave.

 i/p:

 0 1 2 3
 4 5  6 7
 8 9 10 11

 (x1,y1) = (0,0)
 (x2,y2) = (1,2)
 sumArray
 0  1 23
 4  10  18   28
 12 27  45  66
 (will take O(n^2) to build above array)
 So now when you get coordinates as input, you can calc the sum by

 Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

 For our case it will be Ans = 18-0+0 = 18

 Please lemme know if any bugs with the logic.


 On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath 
 srisam261...@gmail.com wrote:


 @ Vicky

 Can yo explain with an illustration ?


 On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:

 May be you can consider creating a 2d array to pre process and store
 all the rectangle sums as a dependent subproblem, the sum of larger rect
 will be currValuesAdded+OldRectSum. So when you get the coordinate as 
 input
 u can calc the needed sum by subtracting sum of big rect and small rect
 which is not included in the given coordinates. This can be called 
 constant
 time if u don't include the preprocessing time.


 On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar algog...@gmail.comwrote:

 Sum of the integers meaning? Do you mind giving an example test case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.comwrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix
 of integers. yo should find the sum of the integers that fall in the 
 region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky




-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group

Re: [algogeeks] google paper

2012-08-11 Thread ~*~VICKY~*~
Can you share the coding questions asked. Thank you.

On Fri, Aug 10, 2012 at 10:29 PM, Abhishek Kumar abhivai...@gmail.comwrote:

 two coding Qs + some mcqs(more than 1 option correct),time is 1.5 hr..


 On Fri, Aug 10, 2012 at 4:06 PM, deepikaanand swinyanand...@gmail.comwrote:

 Somebody from DCE plz tell the paper pattern of google...

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/BjLRVjRlekIJ.
 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.




-- 
Cheers,

  Vicky

-- 
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] Data Cache implementation problem

2012-08-11 Thread ~*~VICKY~*~
It very much looks to be max heap with frequency as value. So maximum
frequent item will be the root and so on. O(logN) complexity for search

On Sat, Aug 11, 2012 at 1:18 PM, Navin Kumar algorithm.i...@gmail.comwrote:

 I think best data structure would be Optimal BST


 On Fri, Aug 10, 2012 at 11:47 PM, Kumar Vishal kumar...@gmail.com wrote:

  Huffman tree ???


 On Fri, Aug 10, 2012 at 11:38 PM, Varma Selvaraj varm...@gmail.comwrote:

 A data cache needs to be implemented for the top 100 data items selected
 based on their frequency of access.
 The most frequent data member must be accessed  fastest. And the access
 time/iterations of each data member from the cache should correspond to the
 frequncy of its access.

 Please choose the right data structure and find the right algorithm for
 the scenario? Can anyone help on this question?


 Thanks and Regards,
 Varma

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




 --
 Regards
 Kumar Vishal
 _
 *http://wethecommonpeople.wordpress.com/   *
 *h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.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.




-- 
Cheers,

  Vicky

-- 
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] Constant time solution needed

2012-08-11 Thread ~*~VICKY~*~
May be you can consider creating a 2d array to pre process and store all
the rectangle sums as a dependent subproblem, the sum of larger rect will
be currValuesAdded+OldRectSum. So when you get the coordinate as input u
can calc the needed sum by subtracting sum of big rect and small rect which
is not included in the given coordinates. This can be called constant time
if u don't include the preprocessing time.

On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar algog...@gmail.com wrote:

 Sum of the integers meaning? Do you mind giving an example test case?

 regards.

 On Sat, Aug 11, 2012 at 7:10 PM, Srividhya srisam261...@gmail.com wrote:

 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix of
 integers. yo should find the sum of the integers that fall in the region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
 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.




-- 
Cheers,

  Vicky

-- 
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] A strange doubt with cpp class. Why compile error ?

2012-03-09 Thread ~*~VICKY~*~
#includeiostream
using namespace std;
class Abc
{

public :
int i;
Abc(){ i = 0;}

};
int main()
{ Abc a = new Abc();
couta.i;
}


-- 
Cheers,

  Vicky

-- 
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: Time Complexity

2011-11-19 Thread ((** VICKY **))
Its level order traversal but its O(n^2) u search entire tree to check
if the nodes level is i (say 0= i = height). i guess can use stack
or queue to get O(n) complexity

On Nov 19, 2:58 pm, shady sinv...@gmail.com wrote:
 this doesn't seem like level order printing, because you are simply
 printing the tree starting with the children as the root node.

 On Sat, Nov 19, 2011 at 12:57 PM, Ankuj Gupta ankuj2...@gmail.com wrote:
  What is the time complexity of this code for Level Order Traversal.

  void printLevel(BinaryTree *p, int level) {
   if (!p) return;
   if (level == 1) {
     cout  p-data   ;
   } else {
     printLevel(p-left, level-1);
     printLevel(p-right, level-1);
   }
  }

  void printLevelOrder(BinaryTree *root) {
   int height = maxHeight(root);
   for (int level = 1; level = height; level++) {
     printLevel(root, level);
     cout  endl;
   }
  }

  My guess is NlogN if tree is balanced if not it will be N^2.

  --
  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: COA Question

2011-11-19 Thread ((** VICKY **))
I guess it could be.
b) position independent code
Keeping relative addressing facilates address independent code as its
always relative. correct me if am wrong.!


On Nov 18, 4:07 pm, Vijay Khandar vijaykhand...@gmail.com wrote:
 Relative mode of addressing is most relevant to writing
 a)coroutines
 b)position-independent code
 c)shareble code
 d)interrupt handlers

 plz anyone give me answer with explation...

-- 
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: Computer Organisation Q

2011-11-17 Thread ((** VICKY **))
False not necessarily.

On Nov 17, 4:03 pm, Vijay Khandar vijaykhand...@gmail.com wrote:
 Can anyone explain following sentence- True or False and explain

 All instructions affect the flags

 Vijay Khandar...

-- 
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] Plz Explain the working

2011-10-03 Thread ~*~VICKY~*~
@Shauib: cool soln. Thank you.

On Mon, Oct 3, 2011 at 6:14 PM, Shuaib aries.shu...@gmail.com wrote:

 Chk is a macro that gets replaced with an if statement. The else part gets
 attached to the most recent if which is the one from the macro. And since
 the condition in macro fails, the else clause is executed.

 --
 Shuaib
 http://twitter.com/ShuaibKhan
 http://www.bytehood.com/

 On 03-Oct-2011, at 4:47 PM, ~*~VICKY~*~ venkat.jun...@gmail.com wrote:

 #includestdio.h
 #define chk(cond) if(!(cond))\
 fprintf(stderr,chk failed: %s,file %s, line %d \n, #cond,\
 __FILE__,__LINE__),abort()
 main()
 {
 int i = 0;
 if(i==0)
 chk(i  100);
 else
 printf(hello);
 printf( world);
 }

 output: hello world

 can anyone clearly explain how this works.


 --
 Cheers,

   Vicky

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




-- 
Cheers,

  Vicky

-- 
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] Doubly linked list with one pointer

2011-10-02 Thread ~*~VICKY~*~
Design a logic to implement doubly linked list with only one pointer
-- 
Cheers,

  Vicky

-- 
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] Doubly linked list with one pointer

2011-10-02 Thread ~*~VICKY~*~
@rahul : can u give any related links plz

On Sun, Oct 2, 2011 at 11:33 PM, rahul sharma rahul23111...@gmail.comwrote:

 xor linked list.

 On Sun, Oct 2, 2011 at 11:32 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:


 Design a logic to implement doubly linked list with only one pointer
 --
 Cheers,

   Vicky

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




-- 
Cheers,

  Vicky

-- 
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] Doubly linked list with one pointer

2011-10-02 Thread ~*~VICKY~*~
ya thanks a lot rahul !

On Sun, Oct 2, 2011 at 11:39 PM, rahul sharma rahul23111...@gmail.comwrote:

 hope u were asking about dat...


 On Sun, Oct 2, 2011 at 11:36 PM, rahul sharma rahul23111...@gmail.comwrote:

 http://www.geeksforgeeks.org/archives/12367


 On Sun, Oct 2, 2011 at 11:34 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 @rahul : can u give any related links plz


 On Sun, Oct 2, 2011 at 11:33 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 xor linked list.

 On Sun, Oct 2, 2011 at 11:32 PM, ~*~VICKY~*~ 
 venkat.jun...@gmail.comwrote:


 Design a logic to implement doubly linked list with only one pointer
 --
 Cheers,

   Vicky

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




 --
 Cheers,

   Vicky

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




-- 
Cheers,

  Vicky

-- 
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] without using '-'

2011-09-26 Thread ~*~VICKY~*~
Find the difference of two numbers without using '-' operator !

plz share ur solutions!

-- 
Cheers,

  Vicky

-- 
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] without using '-'

2011-09-26 Thread ~*~VICKY~*~
Tricky question with more tricky answers. thank you all.

On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav kunalyada...@gmail.com wrote:

 difference = x+ ~y +1

 On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ venkat.jun...@gmail.comwrote:

 Find the difference of two numbers without using '-' operator !

 plz share ur solutions!

 --
 Cheers,

   Vicky

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




 --
 Regards
 Kunal Yadav
 (http://sourcebit.in)


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




-- 
Cheers,

  Vicky

-- 
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] String Question

2011-08-13 Thread vicky S
Given a string which oly has 0's and 1's . Find the maximum largest
substring which have equal no of 0's and 1's and give the length of the
substring .
whether it can be solved in DP ?? or any other soln ?
for example :
given string : 001101000
output :0101

-- 
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] String questions

2011-08-13 Thread vicky S
Given a string which has repeating pattern .Find the repeating pattern and
the length of the pattern .

Example:
123123123123123
output :
123
lenth is 3

1122222211

output :
112211
lenght is 6

-- 
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] TREE question

2011-08-13 Thread vicky S
Given 2 trees .Find wether second tree is the subtree of the first tree .


here is my soln corect me if i m wrong:

bool find(struct node * tree,struct node *subtree)
{

  if(tree==NULL )
 return ;


if(tree-data==subtree-datafind(tree-left,subtree-left) 
find(tree-right,subtree-right) (subtree-left)!=NULL 
subtree-right
!=NULL)
 {
 return true;
}
else
 return false

find(tree-left,subtree);
find(tree-right,subtree);
}

-- 
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] Global Scholar

2011-08-06 Thread vicky S
Any one know how the global scholar written round will be ? whether they
concentrate on OOPs language lik C++ Java or c aptitudes itself enough ? how
wil be the next techinical  rounds ?
Thanks in adcance :)

-- 
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] joining group

2011-07-30 Thread vicky suradkar
i am join this group

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

2011-07-25 Thread ~*~VICKY~*~
Consider the binary representation of 257 which is 10001

which will be stored in little endain representation as least significant
eight bits + most significant eight bits as follows

0001 | 0001

now iptr on casting to char will point to least significant eight bits which
is 1, when u increment iptr it refers to most sig 8 bits which is also 1

hence the o/p will be : 1 1


hope it helps!

On Mon, Jul 25, 2011 at 11:41 AM, aditya kumar aditya.kumar130...@gmail.com
 wrote:

 main()
 {
 int i = 257;
 int *iPtr = i;
 printf(%d %d, *((char*)iPtr), *((char*)iPtr+1) );
 }

 can any one explain me the o/p ??

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




-- 
Cheers,

  Vicky

-- 
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 aps sources plz

2011-07-24 Thread ~*~VICKY~*~
Hi all, as i find it hard to find a site that has a collection of non
obvious or fairly hard  c aps sites anywhere, i seek help here. plz post if
u find any source proving to be useful.


-- 
Cheers,

  Vicky

-- 
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] Non-redundant permutations of the string

2011-07-20 Thread ~*~VICKY~*~
@SkRiPt KiDdIe

kindly explain the working of ur algo with the given example

On Wed, Jul 20, 2011 at 1:09 AM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote:

 #includeiostream
 #includestring
 using namespace std;

 void permute(string str,int x,string print)
 {

 int mask=0;

 if(!x){coutprintendl;return;}

 for(int i=0;ix;i++)
 {
 if(mask(1(str[i]-'a')))continue;
 if(i  i+1x)
 permute(str.substr(0,i)+str.substr(i+1,x-i),x-1,print+str[i]);
 else if(i)
 permute(str.substr(0,i),x-1,print+str[i]);
 else
 permute(str.substr(1,x-1),x-1,print+str[i]);
 mask=mask^(1(str[i]-'a'));
 }
 }

 int main()
 {
 string str,print=;
 cinstr;
 permute(str,str.size(),print);
 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.




-- 
Cheers,

  Vicky

-- 
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] MS interview

2011-07-20 Thread ((** VICKY **))
Given a linked list with a n*n matrix elements write an algo to
compute product of two such linked list.
say n  = 3then

1 2 3
4 5 6
7 8 9

will be given as 1-2-3-4-5-6-7-8-9

now given two matrices , given a algo to perform  matrix
multiplication giving result in thrid linked list.

-- 
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: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread ((** VICKY **))
doing xor of all elements in array[][] should work. you start from a[0]
[0] to a[0][n] then a[1][0] .. when the xor value bcomz 0 then the
corresponding value in arr[i][j] is the first repeated element in the
array. though this code will have two loops and seem as O(n2) it will
terminate once it finds the first repeated no. hope my algo works.
comments plz

On Jul 19, 2:14 am, Dumanshu duman...@gmail.com wrote:
 You have to use parallel computing to find the first repeating number
 in O(n) time if theres nothing special about the 2-D array
 Use n +1 processes, n processes to scan each row and 1 process to scan
 the rows last and next rows first element to check for repetition.
 Each process uses hash table to find the first non repeating number.
 When we have the results from all the processes, do O(n) scanning, and
 output the result for minimum row which wud be the first repetition.

 On Jul 18, 10:42 pm, snehi jain snehijai...@gmail.com wrote:







  this question was asked in an interview.

  Regards
  Snehi

-- 
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: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread ~*~VICKY~*~
Ya sorry abt that my algo is wrong!

On Tue, Jul 19, 2011 at 3:35 PM, Bhanu Kishore bhanukishor...@gmail.comwrote:

 @Venkat. That algorithm doesnt work actually.Try for 9,8,1. At 1 , it
 becomes 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.




-- 
Cheers,

  Vicky

-- 
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: non recursive tree traversals

2010-07-01 Thread vicky
I m adding my program too, with some 2-3 added features:




#include stdio.h
#include stdlib.h
#include string.h
#includeconio.h
#includeiostream
#include stack
#include algorithm
#include queue
using namespace std;
 // BST-node layout
typedef struct Tree{
int data;
Tree *left;
Tree *right;
}treeObject;
// allocate memory to new node. notice pass by address of node
void AllocateMemory(treeObject **node){
*node=new treeObject;
 (*node)-left=(*node)-right=NULL;
}
// insert a new node
void Insert(treeObject *node,treeObject *root,int data){
if(root==NULL){
return;
}
node-data=data;
treeObject *prev=NULL;
treeObject *next=NULL;
next=prev=root;
   while(next!=NULL){
prev=next;
if(next-data=data){
next=next-right;
}
else{
next=next-left;
}
}
if(prev-data=data){
prev-right=node;
}
else{
prev-left=node;
}
}
//recursive inorder traversal
void RecInorder(treeObject *node){
if(node==NULL){
return;
}
RecInorder(node-left);
coutnode-data ;
RecInorder(node-right);
}
//recursive postorder traversal
void RecPostorder(treeObject *node){
if(node==NULL){
return;
}
RecInorder(node-left);
RecInorder(node-right);
coutnode-data ;
}
//recursive preorder traversal
void RecPreorder(treeObject *node){
if(node==NULL){
return;
}
coutnode-data ;
RecInorder(node-left);
RecInorder(node-right);
}
//Iterative Inorder traversal
void IterInorder(treeObject *node){
stacktreeObject * S;
treeObject *temp=node;
while(temp!=NULL){
S.push(temp);
if(temp-left!=NULL){
temp=temp-left;
}
else {
if(temp-left==NULL){
if(temp-right==NULL){
coutS.top()-data ;
if(S.empty()){return;}
S.pop();
if(!S.empty()){
coutS.top()-data ;
temp=S.top()-right;
}
if(S.empty()){return;}
S.pop();
}
else{
coutS.top()-data ;
if(S.empty()){return;}
S.pop();
temp=temp-right;
}
}
}
}
}
void BFT(treeObject *node){
queuetreeObject *Q;
Q.push(node);
while(!Q.empty()){
coutQ.front()-data ;
if(Q.front()-left)Q.push(Q.front()-left);
if(Q.front()-right)Q.push(Q.front()-right);
Q.pop();
}
}

int main(){
treeObject *root;
int i=10;
AllocateMemory(root);
root-data=0;
treeObject *node;
AllocateMemory(node);
Insert(node,root,10);
treeObject *node1;
AllocateMemory(node);
Insert(node,root,71);
treeObject *node2;
AllocateMemory(node);
Insert(node,root,12);
treeObject *node3;
AllocateMemory(node);
Insert(node,root,2);
treeObject *node4;
AllocateMemory(node);
Insert(node,root,222);
treeObject *node5;
AllocateMemory(node);
Insert(node,root,5);
treeObject *node6;
AllocateMemory(node);
Insert(node,root,8);
treeObject *node7;
AllocateMemory(node);
Insert(node,root,65);
treeObject *node8;
AllocateMemory(node);
Insert(node,root,5);
treeObject *node9;
AllocateMemory(node);
Insert(node,root,9);
treeObject *node10;
AllocateMemory(node);
Insert(node,root,1);
coutrecursive Inorder traversal\n;
RecInorder(root);
coutendl;
coutrecursive Postorder traversal\n;
RecPostorder(root);
coutendl;
coutrecursive Preorder traversal\n;
RecPreorder(root);
coutendl;
coutiterative inorder traversal\n;
IterInorder(root);
coutendl;
coutBreadth First Traversal\n;
BFT(root);
getch();
}














On Jun 20, 8:17 am, Gene gene.ress...@gmail.com wrote:
 It might be right.  But it requires marks on the nodes, so it's not a
 fully general algorithm, and probably not what you want.  Here is the
 full algorithm that implements all the orders.  Take your pick.  It
 does turn out that if you don't need post order, you can simplify
 further.  In particular, you no longer need the 1/0 flag stored on the
 stack.  You only need a stack of pointers.

 void si(NODE *tree)
 {

   for (;;) {
     while (tree) {
       printf(preorder %d\n,tree-val);
       PUSH(tree, 0);
      tree=tree-left;
     }
     for (;;) {
       if (!sp) return; // return on stack empty
       if (POP(tree) == 0) {
         printf(inorder %d\n,tree-val);
         PUSH(tree, 1);
        tree=tree-right;
         break;
       }
       printf(postorder %d\n,tree-val);
     }
   }

 }

 On Jun 19, 10:59 am, divya jain 

[algogeeks] A nice Prob

2010-07-01 Thread vicky
It took me more time to understand this problem then solving after i
understood.
You guys too have a look @ it.::
Let f(k) = y where k is the y-th number in the increasing sequence of
non-negative
integers with the same number of ones in its binary representation as
y, e.g. f(0) = 1, f(1) =
1, f(2) = 2, f(3) = 1, f(4) = 3, f(5) = 2, f(6) = 3 and so on. Given k
= 0, compute f(k).

-- 
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] wat will be da algo for this DP problem ?

2009-12-30 Thread vicky
ques-Given a list of N coins, their values (V1, V2, ... , VN), and
the total sum S. Find the minimum number of coins the sum of which is
S (we can use as many coins of one type as we want), or report that
it's not possible to select coins in such a way that they sum up to
S.

ex:
S=11
coins: 1,3,5
ans:3-(5,5,1)

S=6
coins:1,3,5
ans:2,(3,3 or 1,5)

S=20
coins:3,6,8
ans:3,(6,6,8)

S=15
coins:3,7,10
ans: not possible


--

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] An interview question

2009-12-17 Thread vicky
given a graph G(V,E) and a source vertex, v. no. of vetices n, and
edges e. you have to find  all different paths from vertex v to some
vertex N, having exactly i(1in) edges. v,N,i will be given by the
user. provide an algorithm for it.

--

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] A MS QUESTION

2009-12-15 Thread vicky
Given a file with a lot of words (10 million) find out the top 10%
most
frequently occuring words.

--

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: n balls and k different colors 1=k=n

2009-10-10 Thread vicky

i didn't get anything plz elaborate

On Oct 10, 10:44 am, Prunthaban Kanthakumar pruntha...@gmail.com
wrote:
 Sterling numbers of second kind.



 On Sat, Oct 10, 2009 at 10:41 AM, vicky mehta...@gmail.com wrote:

  example:
  n=10,k=10
  ans:1
  n=30,k=7
  ans:
  475020
  On Oct 10, 9:51 am, vicky mehta...@gmail.com wrote:
   u have to color n similar balls with k diff. colors , such that every
   color must be used atleast once find the no. of ways

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



[algogeeks] 100!

2009-10-10 Thread vicky

find some of all the digits in number-100!

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



[algogeeks] n balls and k different colors 1=k=n

2009-10-09 Thread vicky

u have to color n similar balls with k diff. colors , such that every
color must be used atleast once find the no. of ways

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



[algogeeks] Re: n balls and k different colors 1=k=n

2009-10-09 Thread vicky

example:
n=10,k=10
ans:1
n=30,k=7
ans:
475020
On Oct 10, 9:51 am, vicky mehta...@gmail.com wrote:
 u have to color n similar balls with k diff. colors , such that every
 color must be used atleast once find the no. of ways

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



[algogeeks] Re: Form of 3^n

2009-09-23 Thread vicky

ok i can tell one with complexity of O(log(n)) , u take a no. pow =
3,temp=3;
then
while(1){
temp=pow;
pow*=pow;
if(pown){
pow=pow/temp;
break;
}
  }
now do , pow =pow *3; untill pow=n;
and check from here
am i clear?
On Sep 23, 2:40 am, Dave dave_and_da...@juno.com wrote:
 He didn't ask for efficient ways, only other ways.

 On Sep 22, 2:36 pm, Ramaswamy R ramaswam...@gmail.com wrote:



  Can we evaluate the logarithm any more efficiently that repeated division by
  3?

  On Tue, Sep 22, 2009 at 12:27 PM, Dave dave_and_da...@juno.com wrote:

   You could compute the logarithm of the number to the base 3 and see if
   the result is an integer.

   Dave

   On Sep 21, 12:22 pm, Anshya Aggarwal anshya.aggar...@gmail.com
   wrote:
how to find that whether the given number was of the form 3^n. ( i.e. 3
   to
the power n).
one way is to recursively divide the number by 3 and check the 
remainder.
Is there any other way using bit manipulation or anything else??

--
Anshya Aggarwal

  --
  Yesterday is History.
  Tomorrow is a Mystery.
  Today is a Gift! That is why it is called the Present :).

 http://sites.google.com/site/ramaswamyr-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
-~--~~~~--~~--~--~---



[algogeeks] Re: Form of 3^n

2009-09-23 Thread vicky

yaa , that's right as then we are sure of having complexity O(n)

On Sep 23, 4:39 pm, Dufus rahul.dev.si...@gmail.com wrote:
 Vicky, Yup! you got it there.
 BTW you might like to do binary search again instead of sequential
 search when you hit the break condition.
 to indeed make it O(logn).
 Infact if M=3^n is given then this algo would be of complexity O(log
 log M)

 _dufus

 On Sep 23, 11:59 am, vicky mehta...@gmail.com wrote:



  ok i can tell one with complexity of O(log(n)) , u take a no. pow =
  3,temp=3;
  then
  while(1){
  temp=pow;
  pow*=pow;
  if(pown){
      pow=pow/temp;
      break;
      }
    }
  now do , pow =pow *3; untill pow=n;
  and check from here
  am i clear?
  On Sep 23, 2:40 am, Dave dave_and_da...@juno.com wrote:

   He didn't ask for efficient ways, only other ways.

   On Sep 22, 2:36 pm, Ramaswamy R ramaswam...@gmail.com wrote:

Can we evaluate the logarithm any more efficiently that repeated 
division by
3?

On Tue, Sep 22, 2009 at 12:27 PM, Dave dave_and_da...@juno.com wrote:

 You could compute the logarithm of the number to the base 3 and see if
 the result is an integer.

 Dave

 On Sep 21, 12:22 pm, Anshya Aggarwal anshya.aggar...@gmail.com
 wrote:
  how to find that whether the given number was of the form 3^n. ( 
  i.e. 3
 to
  the power n).
  one way is to recursively divide the number by 3 and check the 
  remainder.
  Is there any other way using bit manipulation or anything else??

  --
  Anshya Aggarwal

--
Yesterday is History.
Tomorrow is a Mystery.
Today is a Gift! That is why it is called the Present :).

   http://sites.google.com/site/ramaswamyr-Hidequotedtext -

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



[algogeeks] Re: probabiltiy + DP

2009-09-23 Thread vicky

@ Minjie Zha ,
hey, how does these things clicks to u , as i thought it for 2 hrs.
and still couldn't find a completely correct sol..

On Sep 19, 2:04 pm, Minjie Zha diego...@gmail.com wrote:
 Oh yes, I made a mistake.
 Your are right.

 On Sep 18, 12:02 am, ashish gupta ashish12.it...@gmail.com wrote:



  i think there might be some modification

  On Thu, Sep 17, 2009 at 4:17 PM, Minjie Zha diego...@gmail.com wrote:

   Let PH(j,w) be the probability of getting w heads from 1...j coins,
   0=j=k, 0=w=k.
   So we have:
   PH(0,0) = 1

   PH( j, w ) = 0  if w 0

   PH(0,w) = 0 for w0
   PH(j,0) = (1-P(1))(1-P(2))...(1-P(j))

   PH(j,w) = PH(j-1,w) + PH(j-1,w-1)PH(j)

  and equation should be
  PH(j, w)  = PH(j-1,w) (1-P(j)) + PH( j-1, w-1) PH(j)

  pls correct if i am wrong...

  --
  ashish

   Any comments?

   On Sep 9, 5:50 pm, Nagendra Kumar nagendra@gmail.com wrote:
@all:
          There are k baised coins with probabilty of coming head is
P(i)  i = 1 to k.  If all these coins are  tossed together. find the
probabilty of getting i heads ( i  = k).
   think in Dynamic Programming.
-Nagendra

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