Click here to Skip to main content
15,867,453 members
Home / Discussions / Algorithms
   

Algorithms

 
SuggestionRe: simple maby for you Pin
ZurdoDev12-Dec-14 4:14
professionalZurdoDev12-Dec-14 4:14 
QuestionI'm looking for an algorithm ... Pin
filos14-Dec-14 1:45
filos14-Dec-14 1:45 
AnswerRe: I'm looking for an algorithm ... Pin
Patrice T22-Jun-15 9:36
mvePatrice T22-Jun-15 9:36 
QuestionRandomizing Flickr Tags Based on Search Term Pin
Member 1051454915-Nov-14 1:15
Member 1051454915-Nov-14 1:15 
QuestionAlgorithm to count how many "1" in binary o(1) Pin
Member 1105509311-Nov-14 2:13
Member 1105509311-Nov-14 2:13 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Kornfeld Eliyahu Peter11-Nov-14 2:33
professionalKornfeld Eliyahu Peter11-Nov-14 2:33 
GeneralRe: Algorithm to count how many "1" in binary o(1) Pin
Member 1105509312-Nov-14 1:07
Member 1105509312-Nov-14 1:07 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Richard Deeming11-Nov-14 2:39
mveRichard Deeming11-Nov-14 2:39 
There are several algorithms listed here[^]. For a 32-bit integer, you probably want "Counting bits set, in parallel[^]":
C#
int CountBitsSet(int v)
{
    v = v - ((v >> 1) & 0x55555555);                    // reuse input as temporary
    v = (v & 0x33333333) + ((v >> 2) & 0x33333333);     // temp
    return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

Just don't ask me to explain how it works! Blush | :O



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


SuggestionRe: Algorithm to count how many "1" in binary o(1) Pin
Kornfeld Eliyahu Peter11-Nov-14 2:43
professionalKornfeld Eliyahu Peter11-Nov-14 2:43 
GeneralRe: Algorithm to count how many "1" in binary o(1) Pin
harold aptroot12-Nov-14 9:36
harold aptroot12-Nov-14 9:36 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Aurimas11-Nov-14 3:27
Aurimas11-Nov-14 3:27 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
Joe DiNatale12-Nov-14 8:17
Joe DiNatale12-Nov-14 8:17 
AnswerRe: Algorithm to count how many "1" in binary o(1) Pin
harold aptroot12-Nov-14 10:04
harold aptroot12-Nov-14 10:04 
QuestionPYTHON X-AXIS NEAREST POINT Pin
Member 112001292-Nov-14 6:01
Member 112001292-Nov-14 6:01 
AnswerRe: PYTHON X-AXIS NEAREST POINT Pin
Richard MacCutchan2-Nov-14 6:45
mveRichard MacCutchan2-Nov-14 6:45 
GeneralRe: PYTHON X-AXIS NEAREST POINT Pin
Member 112001292-Nov-14 7:14
Member 112001292-Nov-14 7:14 
GeneralRe: PYTHON X-AXIS NEAREST POINT Pin
Richard MacCutchan2-Nov-14 7:24
mveRichard MacCutchan2-Nov-14 7:24 
GeneralRe: PYTHON X-AXIS NEAREST POINT Pin
Albert Holguin5-Nov-14 10:43
professionalAlbert Holguin5-Nov-14 10:43 
GeneralRe: PYTHON X-AXIS NEAREST POINT Pin
CHill602-Nov-14 10:33
mveCHill602-Nov-14 10:33 
GeneralRe: PYTHON X-AXIS NEAREST POINT Pin
Alan Balkany12-Jan-15 9:03
Alan Balkany12-Jan-15 9:03 
Generalfinger search algorithm using data structure in c-program Pin
Member 111385018-Oct-14 5:31
Member 111385018-Oct-14 5:31 
GeneralRe: finger search algorithm using data structure in c-program Pin
Richard MacCutchan8-Oct-14 6:18
mveRichard MacCutchan8-Oct-14 6:18 
GeneralRe: finger search algorithm using data structure in c-program Pin
harold aptroot8-Oct-14 6:37
harold aptroot8-Oct-14 6:37 
GeneralRe: finger search algorithm using data structure in c-program Pin
Member 111385019-Oct-14 3:33
Member 111385019-Oct-14 3:33 
QuestionHow do I manipulate a series of data chart points against their Y-Axis so they are evenly distributed along the axis? Pin
Brady Kelly20-Sep-14 21:39
Brady Kelly20-Sep-14 21:39 

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.