Re: [algogeeks] Suggestion

2011-08-25 Thread Rahul Singhal
I would suggest Data structure by Tenanbaum is really cool.

On Thu, Aug 25, 2011 at 1:18 PM, Rajeshwar Patra
rajeshwarpa...@gmail.comwrote:

 Go for Debashis Samanta

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




-- 
Rahul singhal

-- 
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] Turbo C vs gcc

2011-08-20 Thread Rahul Singhal
turbo is nothing as compare to gcc..dont even say that u r using turbo..u
will be fired.

On Sat, Aug 20, 2011 at 11:05 PM, Abhishek mailatabhishekgu...@gmail.comwrote:

 which compiler should i use for placement purposes.
 Turbo C or gcc(linux) compiler.


 thanx

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




-- 
Rahul singhal

-- 
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] Any one having ebook of Discrete Mathematics and Its Applications, Kenneth Rosen

2011-08-16 Thread Rahul Singhal
Herllo all,
Plz mail the ebook of  Discrete Mathematics and Its Applications, Kenneth
Rosen, if possioble.

Thanks

-- 
Rahul singhal

-- 
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] [offtopic] Something to share for those preparing for Amazon Campus Interviews!

2011-08-02 Thread Rahul Singhal
They just ask algo and nothing else.Do practise more and look for best
optimisation of every question u do.Questions are common u can get in any
book but the solution they want is not given..u have to optimise the
question.

On Tue, Aug 2, 2011 at 10:15 AM, kumar raja rajkumar.cs...@gmail.comwrote:

 @Rahul:
 Can u tell me what is the main focus of Google ,what are the subjects to
 study and mention some good resources to learn them..

 On 1 August 2011 20:30, Rahul Singhal nitk.ra...@gmail.com wrote:

 @all:
 I have no idea about oracle, as i dont have ne interest in
 database.Regarding google, i m happy to help u.If u have more querirse can
 mail me.


 On Mon, Aug 1, 2011 at 9:41 PM, Supraja Jayakumar 
 suprajasank...@gmail.com wrote:

 Thanks Rahul. Very kind of you.
 I wish you crack Google.

 All the best !

 Best
 Supraja J


 On Thu, Jul 28, 2011 at 6:24 AM, Rahul Menon 
 menonrahul1...@gmail.comwrote:

 Hello friends,

 Recently I appeared for placement interviews for Amazon in my
 campus.Unfortunately though I couldn't make it, still want to share
 something for others here preparing for amazon interviews!

 First of all though it is very hard to crack, here are a few things
 which can make your preparation easier and effective!

 In the interview, I have found that most of the questions asked are
 repeated questions which are available online rather than any new
 questions they have made. A few examples are loop in a linked list,
 print all permuations of a string, binary search in a rotated array
 etc.. These all questions are very commonly found in websites like
 careercup.com and also in this google group. Instead of just going
 through hundreds of question be sure that you can perform the best of
 100% if you are given from these frequently asked questions.

 Just to add, if you are very good in coding it's fine , else make sure
 that you can also code these above questions very well rather than
 just explaining the algos!. They will definitely ask you to code
 these!

 In  Cracking the coding interview all the questions are very very
 important. To my astonishment most of the questions in the sections
 like Linked LIsts, Arrays, Trees and Graph, Recursion from the
 aforesaid book were asked in our interview!  So never miss reading and
 coding these questions before going to your interview.

 Though it's very weird to say, I would say that if you are very very
 good with these around 40 most frequently repeated questions, which
 can be collected through googling, your performance is almost 80%
 guaranteed in the interview. It's sure that you will have to face only
 a very few question outside from this. And if you are somewhat more
 good enough , you can easily make through to the AMAZON!

 All the best for all :)
 Repeating once again, rather than just reading through hundreds of
 questions it would be best if you practice coding and studying the few
 30 interview questions! Else you will have to regret like me :|


 #We will be having Google on our campus soon! I'm totally strange to
 their selection process,tests and intreview, so if anyone have any
 idea please do share here! Thanks!

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




 --
 U

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




 --
 Rahul singhal


  --
 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 Raja
 M.Tech(SIT)
 IIT Kharagpur,
 10it60...@iitkgp.ac.in
 7797137043.
 09491690115.

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




-- 
Rahul singhal

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

Re: [algogeeks] [offtopic] Something to share for those preparing for Amazon Campus Interviews!

2011-08-01 Thread Rahul Singhal
@all:
I have no idea about oracle, as i dont have ne interest in
database.Regarding google, i m happy to help u.If u have more querirse can
mail me.

On Mon, Aug 1, 2011 at 9:41 PM, Supraja Jayakumar
suprajasank...@gmail.comwrote:

 Thanks Rahul. Very kind of you.
 I wish you crack Google.

 All the best !

 Best
 Supraja J


 On Thu, Jul 28, 2011 at 6:24 AM, Rahul Menon menonrahul1...@gmail.comwrote:

 Hello friends,

 Recently I appeared for placement interviews for Amazon in my
 campus.Unfortunately though I couldn't make it, still want to share
 something for others here preparing for amazon interviews!

 First of all though it is very hard to crack, here are a few things
 which can make your preparation easier and effective!

 In the interview, I have found that most of the questions asked are
 repeated questions which are available online rather than any new
 questions they have made. A few examples are loop in a linked list,
 print all permuations of a string, binary search in a rotated array
 etc.. These all questions are very commonly found in websites like
 careercup.com and also in this google group. Instead of just going
 through hundreds of question be sure that you can perform the best of
 100% if you are given from these frequently asked questions.

 Just to add, if you are very good in coding it's fine , else make sure
 that you can also code these above questions very well rather than
 just explaining the algos!. They will definitely ask you to code
 these!

 In  Cracking the coding interview all the questions are very very
 important. To my astonishment most of the questions in the sections
 like Linked LIsts, Arrays, Trees and Graph, Recursion from the
 aforesaid book were asked in our interview!  So never miss reading and
 coding these questions before going to your interview.

 Though it's very weird to say, I would say that if you are very very
 good with these around 40 most frequently repeated questions, which
 can be collected through googling, your performance is almost 80%
 guaranteed in the interview. It's sure that you will have to face only
 a very few question outside from this. And if you are somewhat more
 good enough , you can easily make through to the AMAZON!

 All the best for all :)
 Repeating once again, rather than just reading through hundreds of
 questions it would be best if you practice coding and studying the few
 30 interview questions! Else you will have to regret like me :|


 #We will be having Google on our campus soon! I'm totally strange to
 their selection process,tests and intreview, so if anyone have any
 idea please do share here! Thanks!

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




 --
 U

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




-- 
Rahul singhal

-- 
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] [offtopic] Something to share for those preparing for Amazon Campus Interviews!

2011-07-28 Thread Rahul Singhal
Hi friends,
I would recommend to go through all topics mentioned on tutorials on site
topcoder for google.Make a note, do practise more of greedy and dynamic
programming questions.In final rounds of interview, they generally ask
questions involving probability along with computation which is also covered
in topcoder.
Best of luck.

On Thu, Jul 28, 2011 at 6:28 PM, Muthu Raj sameer.mut...@gmail.com wrote:

 Thnks a lot  neha :)
 *Muthuraj R.
 4TH Year BE.**
 Information Science Dept*
 *PESIT, Bengaluru .
 *





 On Thu, Jul 28, 2011 at 6:01 PM, Neha Sharan neharick...@gmail.comwrote:

 @rahul:what kind of questons were asked in aptitude test?

 On Thu, Jul 28, 2011 at 5:54 PM, Rahul Menon menonrahul1...@gmail.comwrote:

 Hello friends,

 Recently I appeared for placement interviews for Amazon in my
 campus.Unfortunately though I couldn't make it, still want to share
 something for others here preparing for amazon interviews!

 First of all though it is very hard to crack, here are a few things
 which can make your preparation easier and effective!

 In the interview, I have found that most of the questions asked are
 repeated questions which are available online rather than any new
 questions they have made. A few examples are loop in a linked list,
 print all permuations of a string, binary search in a rotated array
 etc.. These all questions are very commonly found in websites like
 careercup.com and also in this google group. Instead of just going
 through hundreds of question be sure that you can perform the best of
 100% if you are given from these frequently asked questions.

 Just to add, if you are very good in coding it's fine , else make sure
 that you can also code these above questions very well rather than
 just explaining the algos!. They will definitely ask you to code
 these!

 In  Cracking the coding interview all the questions are very very
 important. To my astonishment most of the questions in the sections
 like Linked LIsts, Arrays, Trees and Graph, Recursion from the
 aforesaid book were asked in our interview!  So never miss reading and
 coding these questions before going to your interview.

 Though it's very weird to say, I would say that if you are very very
 good with these around 40 most frequently repeated questions, which
 can be collected through googling, your performance is almost 80%
 guaranteed in the interview. It's sure that you will have to face only
 a very few question outside from this. And if you are somewhat more
 good enough , you can easily make through to the AMAZON!

 All the best for all :)
 Repeating once again, rather than just reading through hundreds of
 questions it would be best if you practice coding and studying the few
 30 interview questions! Else you will have to regret like me :|


 #We will be having Google on our campus soon! I'm totally strange to
 their selection process,tests and intreview, so if anyone have any
 idea please do share here! Thanks!

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




-- 
Rahul singhal

-- 
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] required ebook of Top down approach networking book 4th edition + tenanbaum os solution

2011-06-07 Thread Rahul Singhal
Dear All,
If you have any ebook mentioned above, please share them.
Thanks

-- 
Rahul singhal

-- 
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: Adobe Questions

2010-08-21 Thread Rahul Singhal
I think u r right lucky

On Sat, Aug 21, 2010 at 11:45 AM, luckyzoner luckyzo...@gmail.com wrote:

 With reference to the first question...I would say that both the
 statements were given seperately.
 The answer to the question is : Hello Hello...as i have tried it out.
 The reason for the output as i think is that the class functions are
 allocated the memory even if no object of the class has been created
 and the functions are passed the address of the object when an object
 tries to call the member functions.

 In this case when calling A-print().although the A has a garbage
 valueit is still a address which is being used to call the
 function.

 And also in case of B-print().u are passing 0 as an address to
 the member function.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Adobe Question : Convert a number given in base B1 to a number in base B2 without using any intermediate base

2010-08-18 Thread Rahul Singhal
Hi
example
(83)base 5 -- ()base7
num temp_num resultcarry
83   3* 1   (3/7) =0(3%7)=3
838*5   (40/7)=5   (40%7)=5

result=0+5=5
carry= 3+5=8

   temp_carry=call convert for carry in which base is 10 and target base is
7
   (temp_carry will become 11)
   carry=temp_carry%10;
   (carry will become 1)
   result=result +temp_carry/10;
   (result will become 6)
call convert for result in which base is 10 and target base is 7
   (result remain 6)
result=result*10 + carry
result 61
return result

The logic would remain same for hexadecimal base also but implementation
would differ


On Wed, Aug 18, 2010 at 6:41 PM, sumant hegde sumant@gmail.com wrote:

 It is not clear whether 'subtraction' operation for given base B1 is
 granted defined or you should write code for it. If it is already defined,
 then simulating division (working wrt base B1) is easy (repeated
 subtraction). Then the normal procedure of converting a number from base 10
 to base b2 would work, where you divide the number by B2, note down the
 remainder, replace dividend by the quotient and repeat the process until the
 dividend becomes zero. Finally you concatenate the remainders in the reverse
 order.

 Ex: From 214 of base 5 to base 16.
 16 is 31 of base 5 so,
 214 / 31 =* **3* ;  214 % 31 = 21;  [ / and % work wrt base 5 which is
 to be programmed using repeated subtraction ]
 *3* / 31 = 0 ;   3 % 31 = 3;

 finally
 3,21
 or
 3B coz  B is hex equivalent of 21_base5

 OR
 in your simpler algo, is it not possible to define functions that 'get' and
 'set' a particular digit, by using / and % ?
 Thanks,
 Summ

 On Tue, Aug 17, 2010 at 9:50 PM, luckyzoner luckyzo...@gmail.com wrote:

 I had proposed an algorithm of repeatedly subtracting 1 from the given
 number and subsequently adding 1 to the new number initialised to 0,
 till the given number becomes 0. However as soon as the digit reaches
 the limit , the digit becomes 0 and you add 1 to the next digit. I was
 not able to code it properly as i had to use int data type only. It
 would have been easy if the array of integers was allowed to use.

 Pls suggest the code for the same or some better algo.

 Thanx
 Lakshaya

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Shuffling a deck of cards

2010-08-15 Thread Rahul Singhal
Let X1, X2…. XN (In this case N=52) be the set of N numbers to be shuffled.

   1. Set j to N
   2. Generate a random number R. (uniformly distributed between 0 and 1)
   3. Set k to (jR+1). k is now a random integer, between 1 and j.
   4. Exchange Xk and Xj
   5. Decrease j by 1.
   6. If j  1, return to step 2.

 void Shuffle(int* pArr)
{
int rand;
for(int i=51;i=0;i--)
{
rand=GenRand(0,i);
swap(pArr[i], pArr[rand]);
}
}

GenRand(int min, int max) generates a random number between min and max.


On Sun, Aug 15, 2010 at 9:10 AM, Dave dave_and_da...@juno.com wrote:

 @Sharad: Your code does not produce equally probable shuffles. You can
 see this by noting that a[0] is swapped with one of 52 cards, same for
 a[1], a[2], ..., a[51]. Thus, there are 52^52 possible sets of swaps.
 But there are only 52! possible outcomes, and 52^52 / 52! is not an
 integer.

 You can verify this experimentally by shuffling a small deck, say 3
 cards. If you do so, you will find that, starting with the deck ABC,
 you get ABC 4/27 of the time, ACB 5/27, BAC 5/27, BCA 5/27, CAB 4/27,
 and CBA 4/27. Thus, some outcomes are 25% more likely than others.

 The proper code is
 for(i=1;i52;++i)
 {
 int r=rand()%(i+1);
 swap(a[i],a[r]);
 }

 Dave

 On Aug 14, 9:34 pm, sharad kumar aryansmit3...@gmail.com wrote:
  for(i=0;i52;++i)
  {
  int r=rand()%52;
  swap(a[i],a[r]);
 
  }
  On Sat, Aug 14, 2010 at 11:46 PM, amit amitjaspal...@gmail.com wrote:
   write a program to shuffle an pack of cards in the most efficient way.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algoge...@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups­.com
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  yezhu malai vaasa venkataramana Govinda Govinda

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Addition Of numbers in SLL

2010-08-14 Thread Rahul Singhal
i think we can access numbers from last so no need to reverse it and also we
can store it in linke list in stack way so again no need to reverse the
linked list.

On Sat, Aug 14, 2010 at 7:03 PM, Gaurav Singh gogi.no...@gmail.com wrote:

 Reversing the lists and then adding and then reversing the final list
 is the most appropriate method. Bcoz the lists may contain
 arbitarily large numbers, so forming integers then adding is not
 logical here.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Addition Of numbers in SLL

2010-08-14 Thread Rahul Singhal
I men to say ki just traverse from last instead of reversing it and storing
result in a stack in linked list form so that we dont need to reverse
again.Hope,i made myself clear.

On Sat, Aug 14, 2010 at 11:40 PM, Lokesh Agarwal lokesh...@gmail.comwrote:

 how can you traverse from last without reversing it.

 and there is no need fof using extra stack space.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Dynamic Programming Problem on Strings

2010-07-17 Thread Rahul Singhal
It can be solved with trie

On Sun, Jul 18, 2010 at 10:28 AM, Ashish Goel ashg...@gmail.com wrote:

 dp[i][0]=1 implies that there is 1 combination which will ensure that the
 number of A's and B's is same in the string.
 eg AAA is not a valid string

 dp[0][0]=1 doesnot satisfy property 1 either

 with this algo and tring length 4(possible strings AABB, ABAB)


 a[i][j] will look like

 1 1 1
 0 1 0
 0 1 1


 also, donot understand the logic why n/2 is chosen?



 Best Regards
 Ashish Goel
 Think positive and find fuel in failure
 +919985813081
 +919966006652



 On Tue, Jul 13, 2010 at 3:39 AM, Amir hossein Shahriari 
 amir.hossein.shahri...@gmail.com wrote:

 dp[i][j] is the number of strings that have i As and j Bs


 dp[0][0]=1;   //   s=
 for (i=1;i=n/2;i++)

 dp[i][0]=1;  //   s=AAA...

 for (i=1;i=n/2;i++)

 dp[0][i]=0;  //   the 2nd constraint

 for (i=1;i=n/2;i++)

 for (j=1;j=n/2;j++)

 if (ji)

 dp[i][j]=0; //   the 2nd constraint

 else

 dp[i][j]=dp[i-1][j]+dp[i][j-1];


 dp[n/2][n/2] would be the result

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: seg fault

2010-06-22 Thread Rahul Singhal
I think its due to typecasting of char to int
just change char a,b to int a,b
or
last line change inside scan %c
segementation fault will not come
as size of char is less than size of int

On Tue, Jun 22, 2010 at 3:37 PM, Shravan shravann1...@gmail.com wrote:

 %c is the format specifier for char.Provide space between them.
 On Jun 22, 2:54 pm, sharad sharad20073...@gmail.com wrote:
  #includestdio.h
 
  int main()
 
  {
 
  char a,b;
 
  printf(%d\n,12);
 
  printf(%d\n,printf(%d,143));
 
  printf(%d\n,scanf(%2d%3d,a,b));}
 
  y this prog is giving seg fault after all its 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Rahul singhal
RnD Engineer
Tejas Networks
Mobile- 09916969422

-- 
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: Check divisibility by 3

2009-08-14 Thread Rahul Singhal
i think use of shift operator can do d job

On Fri, Aug 14, 2009 at 1:15 PM, richa gupta richa.cs...@gmail.com wrote:


 can we check the divisibility of a given number by 3 withoutusing
 operators like '/' or '%'.
 I want the efficient solution to this problem ..

 can someone help ??
 --
 Richa Gupta
 (IT-BHU,India)

 



-- 
Rahul singhal
RnD Engineer
Tejas Networks
Banglore-09416725998

--~--~-~--~~~---~--~~
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: Backtracking algorithm

2008-11-04 Thread Rahul Singhal
there ia a book called FUNDAMENTALS OF DATA STRUCTURES BY HOROWITZS AND
SAHNI.

NOTE:There are two versions of it.The ebook of the version containing this
topic is not available as per knowlegde but it is available in market.This
version's size is long as compare to other version.
This topic is nicely presented in that book with the help of examples and
some good exercise questions at the end of the chapter

On Tue, Nov 4, 2008 at 10:12 AM, Luciano Pinheiro [EMAIL PROTECTED]wrote:


 Please, help me people !

 I need understand and develop a backtracking algorithm to include into
 a program and I don't nkow where find these.

 Someone have any document, or URL to indicate to me ?

 Sincerely,

 
 Luciano Soares Pinheiro Jr.
 Analista desenvolvedor Sr.

 



-- 
Rahul singhal
B.Tech. PART IV
Department of Computer Engineering
NIT Kurukshetra
Kurukshetra

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Operating System

2008-06-05 Thread Rahul Singhal
hey,
i also want solution

On Thu, Jun 5, 2008 at 6:11 PM, Pratyush [EMAIL PROTECTED] wrote:


 Does anybody know if there is a reference manual or solutions to the
 exersises to The Design of the Unix Operating Systems by Maurice J
 Bach.
 



-- 
Rahul singhal
B.Tech. PART III
Department of Computer Engineering
NIT Kurukshetra
Kurukshetra

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---