Click here to Skip to main content
15,898,920 members
Home / Discussions / Algorithms
   

Algorithms

 
SuggestionRe: Root Sorting Pin
Ashutosh_se9-Nov-16 3:13
Ashutosh_se9-Nov-16 3:13 
GeneralRe: Root Sorting Pin
Manfred Rudolf Bihy9-Nov-16 3:25
professionalManfred Rudolf Bihy9-Nov-16 3:25 
Questionwhich algorithm dominates f(n) or (g(n)) Pin
Member 127799066-Oct-16 7:11
Member 127799066-Oct-16 7:11 
AnswerRe: which algorithm dominates f(n) or (g(n)) Pin
Afzaal Ahmad Zeeshan6-Oct-16 7:32
professionalAfzaal Ahmad Zeeshan6-Oct-16 7:32 
GeneralRe: which algorithm dominates f(n) or (g(n)) Pin
Member 127799066-Oct-16 8:50
Member 127799066-Oct-16 8:50 
Questionquestion about cycle reduction problem Pin
Member 127782295-Oct-16 10:58
Member 127782295-Oct-16 10:58 
AnswerRe: question about cycle reduction problem Pin
Chris Losinger6-Oct-16 3:59
professionalChris Losinger6-Oct-16 3:59 
Questionbooth's algorithm vs russian peasant's algorithm for multiplying two binary numbers Pin
EZCodeProject27-Sep-16 13:45
EZCodeProject27-Sep-16 13:45 
If I want to compute/calculate A*B, then:
In russian peasant's algorithm:
declare and define new helper variable C and P for product, initialized to 0, i.e. all bits are initialized to 0.

NOW:

1. copy A to C
2. Select 1 random bit 1 (whose value/state is 1) of B and left shift C the number of bits that come in right of the selected bit, i.e. if B=0000100, then C should be left shifted 2 bits, because there are 2 bits in right of the single bit 1 of B.
The new bits of C after the left shift are set to 0.
3. Add C to P
4. Turn the selected bit to 0 and if B becomes 0, i.e. all bits are 0, then P is the product of A and B, i.e. P=A*B, otherwise/else repeat all steps, i.e. redo step 1, 2, 3, 4 and etc.

Is that correct/right? If yes, then why CPU/ALU is designed to use Booth's algorithm instead of Russian Peasant's algorithm? In some cases, Russian Peasant's algorithm can be much easy to perform than Booth's algorithm, when most bits of the multiplier B, are 0, and only few are 1.
AnswerRe: booth's algorithm vs russian peasant's algorithm for multiplying two binary numbers Pin
harold aptroot28-Sep-16 3:11
harold aptroot28-Sep-16 3:11 
GeneralRe: booth's algorithm vs russian peasant's algorithm for multiplying two binary numbers Pin
EZCodeProject28-Sep-16 7:08
EZCodeProject28-Sep-16 7:08 
QuestionTrying to get additions, deletions and changes between 2 file versions Pin
Christopher Cote26-Sep-16 2:56
Christopher Cote26-Sep-16 2:56 
AnswerRe: Trying to get additions, deletions and changes between 2 file versions Pin
Peter_in_278026-Sep-16 17:41
professionalPeter_in_278026-Sep-16 17:41 
GeneralRe: Trying to get additions, deletions and changes between 2 file versions Pin
Christopher Cote5-Dec-16 3:12
Christopher Cote5-Dec-16 3:12 
QuestionCompress items of size based on width and height Pin
jkirkerx20-Sep-16 13:59
professionaljkirkerx20-Sep-16 13:59 
SuggestionRe: Compress items of size based on width and height Pin
Maciej Los26-Sep-16 4:44
mveMaciej Los26-Sep-16 4:44 
AnswerRe: Compress items of size based on width and height Pin
Maciej Los26-Sep-16 12:01
mveMaciej Los26-Sep-16 12:01 
GeneralRe: Compress items of size based on width and height Pin
jkirkerx27-Sep-16 7:46
professionaljkirkerx27-Sep-16 7:46 
QuestionRe: Compress items of size based on width and height [Modified] Pin
Maciej Los27-Sep-16 8:39
mveMaciej Los27-Sep-16 8:39 
AnswerRe: Compress items of size based on width and height [Modified] Pin
jkirkerx27-Sep-16 10:42
professionaljkirkerx27-Sep-16 10:42 
GeneralRe: Compress items of size based on width and height [Modified] Pin
Maciej Los27-Sep-16 21:41
mveMaciej Los27-Sep-16 21:41 
GeneralRe: Compress items of size based on width and height [Modified] Pin
jkirkerx28-Sep-16 6:36
professionaljkirkerx28-Sep-16 6:36 
GeneralThis is what I released today for production testing Pin
jkirkerx30-Sep-16 7:26
professionaljkirkerx30-Sep-16 7:26 
GeneralRe: This is what I released today for production testing Pin
Maciej Los4-Oct-16 9:22
mveMaciej Los4-Oct-16 9:22 
GeneralRe: This is what I released today for production testing Pin
jkirkerx4-Oct-16 9:30
professionaljkirkerx4-Oct-16 9:30 
GeneralRe: This is what I released today for production testing Pin
Maciej Los4-Oct-16 9:34
mveMaciej Los4-Oct-16 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.