Click here to Skip to main content
15,888,337 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: "Best Fit" Algorithm Request && Teach A Man To Fish Pin
Luc Pattyn19-Apr-10 12:45
sitebuilderLuc Pattyn19-Apr-10 12:45 
GeneralRe: "Best Fit" Algorithm Request && Teach A Man To Fish Pin
Tim Craig19-Apr-10 12:48
Tim Craig19-Apr-10 12:48 
GeneralRe: "Best Fit" Algorithm Request && Teach A Man To Fish [modified] Pin
harold aptroot19-Apr-10 12:56
harold aptroot19-Apr-10 12:56 
GeneralRe: "Best Fit" Algorithm Request && Teach A Man To Fish Pin
Tadeusz Westawic23-Apr-10 2:24
Tadeusz Westawic23-Apr-10 2:24 
AnswerRe: "Best Fit" Algorithm Request && Teach A Man To Fish Pin
Tadeusz Westawic23-Apr-10 3:57
Tadeusz Westawic23-Apr-10 3:57 
QuestionCSMA / CA Pin
hairy_hats14-Apr-10 4:59
hairy_hats14-Apr-10 4:59 
AnswerRe: CSMA / CA Pin
Anshul R9-Jun-10 4:14
Anshul R9-Jun-10 4:14 
QuestionBeating LabView's "Spreadsheet String To Array" function Pin
PaulowniaK7-Apr-10 20:21
PaulowniaK7-Apr-10 20:21 
I have this 3rd party software that spits out a list of numbers formatted into text. They are integers but of varying number of digits. I usually get around 10,000 numbers in one string.

I'm turning all these numbers into an array of integers in C++ but it's taking me over 200 milli-seconds.

I was told that LabView can do the same thing in less than a milli-second.

Then a kind CP patron ran an experiment on C# and told me it only takes up to 20 milli-seconds.

I'm using CString::Find() to look for the space that separates each number in the string and CString::Mid() to get a piece of string per number and finally atoi() to turn it into integer. I know CString is slow, but I'm a bit surprised at the difference in the time of execution.

What is LabView doing that is so wonderful?
How can I improve my code in C++? Someone said something about not using Mid() to create new string each time but to put a section of char* directly into atoi(). I'm not sure how to do that except for doing things like memcpy in which case I might as well create a new CString as I do now.

Any ideas appreciated!
Almost, but not quite, entirely unlike... me...

AnswerRe: Beating LabView's "Spreadsheet String To Array" function Pin
Phil Martin7-Apr-10 20:29
professionalPhil Martin7-Apr-10 20:29 
AnswerRe: Beating LabView's "Spreadsheet String To Array" function Pin
J. Dunlap7-Apr-10 20:53
J. Dunlap7-Apr-10 20:53 
AnswerRe: Beating LabView's "Spreadsheet String To Array" function Pin
AspDotNetDev7-Apr-10 23:06
protectorAspDotNetDev7-Apr-10 23:06 
AnswerRe: Beating LabView's "Spreadsheet String To Array" function Pin
CPallini15-Apr-10 23:23
mveCPallini15-Apr-10 23:23 
Question15 puzzle solution in C or C++ Pin
123lucy457-Apr-10 5:25
123lucy457-Apr-10 5:25 
AnswerRe: 15 puzzle solution in C or C++ Pin
Luc Pattyn7-Apr-10 5:56
sitebuilderLuc Pattyn7-Apr-10 5:56 
GeneralRe: 15 puzzle solution in C or C++ Pin
Paul Conrad7-Apr-10 6:35
professionalPaul Conrad7-Apr-10 6:35 
AnswerRe: 15 puzzle solution in C or C++ Pin
Dave Kreskowiak7-Apr-10 7:03
mveDave Kreskowiak7-Apr-10 7:03 
GeneralRe: 15 puzzle algorithm in C or C++ Pin
123lucy457-Apr-10 16:11
123lucy457-Apr-10 16:11 
GeneralRe: 15 puzzle algorithm in C or C++ Pin
Luc Pattyn7-Apr-10 17:07
sitebuilderLuc Pattyn7-Apr-10 17:07 
GeneralRe: 15 puzzle algorithm in C or C++ Pin
Dave Kreskowiak7-Apr-10 17:42
mveDave Kreskowiak7-Apr-10 17:42 
GeneralRe: 15 puzzle algorithm in C or C++ Pin
Alan Balkany9-Apr-10 4:28
Alan Balkany9-Apr-10 4:28 
QuestionA simple algorithm request Pin
Michael J. Eber24-Mar-10 13:19
Michael J. Eber24-Mar-10 13:19 
AnswerRe: A simple algorithm request Pin
Amar Chaudhary24-Mar-10 15:25
Amar Chaudhary24-Mar-10 15:25 
AnswerRe: A simple algorithm request Pin
Dr.Walt Fair, PE24-Mar-10 15:29
professionalDr.Walt Fair, PE24-Mar-10 15:29 
AnswerRe: A simple algorithm request Pin
Luc Pattyn24-Mar-10 15:54
sitebuilderLuc Pattyn24-Mar-10 15:54 
QuestionFilling a cylinder or a tube Pin
Valeriant20-Mar-10 17:46
Valeriant20-Mar-10 17:46 

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.