Click here to Skip to main content
15,923,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionquestion regarding sockets Pin
mkrtchyanmarianna9-Jun-09 2:15
mkrtchyanmarianna9-Jun-09 2:15 
AnswerRe: question regarding sockets Pin
led mike9-Jun-09 4:33
led mike9-Jun-09 4:33 
QuestionDetermining efficiency / most-efficient algorithm [modified] Pin
Mike the Red9-Jun-09 1:16
Mike the Red9-Jun-09 1:16 
AnswerRe: Determining efficiency / most-efficient algorithm Pin
Stuart Dootson9-Jun-09 2:11
professionalStuart Dootson9-Jun-09 2:11 
GeneralRe: Determining efficiency / most-efficient algorithm Pin
Mike the Red9-Jun-09 2:24
Mike the Red9-Jun-09 2:24 
GeneralRe: Determining efficiency / most-efficient algorithm Pin
Stuart Dootson9-Jun-09 2:29
professionalStuart Dootson9-Jun-09 2:29 
AnswerRe: Determining efficiency / most-efficient algorithm Pin
led mike9-Jun-09 4:23
led mike9-Jun-09 4:23 
AnswerRe: Determining efficiency / most-efficient algorithm Pin
Chris Losinger9-Jun-09 5:02
professionalChris Losinger9-Jun-09 5:02 
Mike the Red wrote:
How do I determine what is efficent/inefficient, or, more specifically, given two algorithms to accomplish a task, how do I determine which is more efficient?


you have to identify at all the different actions each algorithm takes, how many times each action is performed for a given input, and the relative costs of those actions. then you can see which operations dominate the processing time for each algorithm. knowing that will help you get an idea as to which algorithm is going to do better for a given input. it might turn out that one algorithm is very fast for small input, but is terrible for large input; so you can switch between them.

Mike the Red wrote:
Is the most memory-efficient always the fastest-executing?


no. and for reasonable amounts of memory, there's probably very little correlation between memory usage and performance. if using more memory lets you turn an O(N2) algorithm (execution time increases with the square of the input size) into a O(1) algorithm (execution time is constant, regardless of the size of the input), use the memory.

Big O Notation[^]

for example[^]


Questionquestion regarding sockets Pin
mkrtchyanmarianna9-Jun-09 1:01
mkrtchyanmarianna9-Jun-09 1:01 
QuestionRe: question regarding sockets Pin
CPallini9-Jun-09 1:50
mveCPallini9-Jun-09 1:50 
AnswerRe: question regarding sockets Pin
mkrtchyanmarianna9-Jun-09 2:14
mkrtchyanmarianna9-Jun-09 2:14 
GeneralRe: question regarding sockets Pin
CPallini9-Jun-09 2:20
mveCPallini9-Jun-09 2:20 
QuestionLoadLibraryA & LoadLibraryW Pin
chirag_chauhan8-Jun-09 23:05
chirag_chauhan8-Jun-09 23:05 
AnswerRe: LoadLibraryA & LoadLibraryW Pin
Pops80028-Jun-09 23:18
Pops80028-Jun-09 23:18 
AnswerRe: LoadLibraryA & LoadLibraryW Pin
«_Superman_»8-Jun-09 23:24
professional«_Superman_»8-Jun-09 23:24 
GeneralRe: LoadLibraryA & LoadLibraryW Pin
chirag_chauhan8-Jun-09 23:31
chirag_chauhan8-Jun-09 23:31 
GeneralRe: LoadLibraryA & LoadLibraryW Pin
«_Superman_»8-Jun-09 23:34
professional«_Superman_»8-Jun-09 23:34 
AnswerRe: LoadLibraryA & LoadLibraryW Pin
KarstenK8-Jun-09 23:46
mveKarstenK8-Jun-09 23:46 
QuestionError while trying to free memory allocated using malloc Pin
dcj19848-Jun-09 23:04
dcj19848-Jun-09 23:04 
AnswerRe: Error while trying to free memory allocated using malloc Pin
CPallini8-Jun-09 23:10
mveCPallini8-Jun-09 23:10 
AnswerRe: Error while trying to free memory allocated using malloc Pin
chirag_chauhan8-Jun-09 23:11
chirag_chauhan8-Jun-09 23:11 
AnswerRe: Error while trying to free memory allocated using malloc Pin
«_Superman_»8-Jun-09 23:28
professional«_Superman_»8-Jun-09 23:28 
AnswerRe: Error while trying to free memory allocated using malloc Pin
Code-o-mat9-Jun-09 0:41
Code-o-mat9-Jun-09 0:41 
QuestionIntroducing mouse delay (local machine) Pin
Kannan Ramanathan8-Jun-09 20:52
Kannan Ramanathan8-Jun-09 20:52 
AnswerRe: Introducing mouse delay (local machine) Pin
«_Superman_»8-Jun-09 22:37
professional«_Superman_»8-Jun-09 22:37 

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.