[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Ajinkya Kale
@Vinay : Can you please explain the algorithm of your code.. On 10/7/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote: > > How about recursive way: > > int funcNoDiv(int divisor, int dividend) > { > //base case > if(divisor == dividend) > { > return 1; > } > > else if( divisor > divide

[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Vinay Chilakamarri
Sorry but lets start with a quotient of 1 On 10/7/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote: > > How about recursive way: > > int funcNoDiv(int divisor, int dividend) > { > //base case > if(divisor == dividend) > { > return 1; > } > > else if( divisor > dividend) > { > r

[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Vinay Chilakamarri
How about recursive way: int funcNoDiv(int divisor, int dividend) { //base case if(divisor == dividend) { return 1; } else if( divisor > dividend) { return 0; } else // divisor < dividend { while(divisor <= dividend) { divisor = divisor << 1; r

[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Ajinkya Kale
use subtraction in a loop till remainder is smaller then divisor. On 10/7/07, megha <[EMAIL PROTECTED]> wrote: > > > Hi all, > > I am looking for the program/algorithm to implement division without > using divide operator? > > Any idea? > > Thanks > > > > > -- Ciao, Ajinkya --~--~-~--~

[algogeeks] NxN matrix of positive and negetive integers?

2007-10-07 Thread megha
given N x N matrix of positive and negetive intergers. Write some code that finds the sub-matrix with teh maximum sum of its elements. Any ideas? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm G

[algogeeks] Implement division without using divide operator

2007-10-07 Thread megha
Hi all, I am looking for the program/algorithm to implement division without using divide operator? Any idea? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group,

[algogeeks] Re: Programing problem

2007-10-07 Thread Ajinkya Kale
On 10/7/07, macharla pradeep <[EMAIL PROTECTED]> wrote: > > Hi, > if ( commnad sequence is bad ) > whether to include it area calculation or not?? > It is mentioned that command sequence is never bad. > On 10/5/07, piruk <[EMAIL PROTECTED]> wrote: > > > > > > Hi. > > How to solve this ta

[algogeeks] Re: Programing problem

2007-10-07 Thread macharla pradeep
Hi, if ( commnad sequence is bad ) whether to include it area calculation or not?? On 10/5/07, piruk <[EMAIL PROTECTED]> wrote: > > > Hi. > How to solve this task? > > > Areameter is a turtle-like self-propelled vehicle controlled by > sequences of commands transmitted over a radio channel

[algogeeks] Re: How to solve this problem efficiently?

2007-10-07 Thread Sticker
I guess it is binary search tree. Try this and you will get what you want. On Sep 26, 5:12 am, "mukesh agrawal" <[EMAIL PROTECTED]> wrote: > What is binary index tree ? I googled it finding irrelevent information ... > help needed .. > > On 9/25/07, Mohammad Naser Zandy <[EMAIL PROTECTED]> wrote: