Click here to Skip to main content
15,915,733 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Travelling Salesman Problem Pin
mehata7-Nov-06 16:57
mehata7-Nov-06 16:57 
GeneralRe: Travelling Salesman Problem Pin
Just me at will_george...something8-Nov-06 2:12
Just me at will_george...something8-Nov-06 2:12 
QuestionRe: Travelling Salesman Problem Pin
DHIRAJ SHETI7-Dec-06 18:05
DHIRAJ SHETI7-Dec-06 18:05 
AnswerRe: Travelling Salesman Problem Pin
ednrgc6-Nov-06 6:18
ednrgc6-Nov-06 6:18 
AnswerCross poster not doing their own homework Pin
leckey6-Nov-06 6:45
leckey6-Nov-06 6:45 
GeneralRe: Cross poster not doing their own homework Pin
Paul Conrad7-Nov-06 6:53
professionalPaul Conrad7-Nov-06 6:53 
GeneralRe: Cross poster not doing their own homework [modified] Pin
Just me at will_george...something8-Nov-06 2:33
Just me at will_george...something8-Nov-06 2:33 
QuestionDestructing a large data structure Pin
Steve M.5-Nov-06 15:56
Steve M.5-Nov-06 15:56 
I have a general question about de-allocating memory for large data structures.

If you have any large data structure, say a tree with many nodes, your destructor (assuming you're working in C++) would have to traverse each node to destroy it, right? Essentially, your destructor is an O(n) operation, where n is the number of nodes in the data structure. Makes sense so far, right?

Maybe I'm horribly naive, but this seems like a very slow way to destroy a data structure. When you close a large document, like a Photoshop document, the document appears to close and release memory quickly. How are the large data structures that make up the document destroyed so quickly? Is it typical for a destructor to traverse each node, or am I missing some well-known practice to get around this?

Thanks,
Steve
AnswerRe: Destructing a large data structure Pin
El Corazon5-Nov-06 20:28
El Corazon5-Nov-06 20:28 
GeneralRe: Destructing a large data structure Pin
Steve S7-Nov-06 1:08
Steve S7-Nov-06 1:08 
GeneralNumerical Recipes in C# Pin
Bassam Abdul-Baki31-Oct-06 5:18
professionalBassam Abdul-Baki31-Oct-06 5:18 
GeneralRe: Numerical Recipes in C# Pin
djlove31-Oct-06 22:42
djlove31-Oct-06 22:42 
GeneralRe: Numerical Recipes in C# Pin
Just me at will_george...something8-Nov-06 3:09
Just me at will_george...something8-Nov-06 3:09 
QuestionSi units in C++ Pin
Toastersparks31-Oct-06 4:34
Toastersparks31-Oct-06 4:34 
AnswerRe: Si units in C++ Pin
Maximilien31-Oct-06 6:49
Maximilien31-Oct-06 6:49 
GeneralRe: Si units in C++ Pin
Stephen Hewitt31-Oct-06 12:01
Stephen Hewitt31-Oct-06 12:01 
AnswerRe: Si units in C++ Pin
Stephen Hewitt31-Oct-06 11:59
Stephen Hewitt31-Oct-06 11:59 
GeneralRe: Si units in C++ Pin
Maximilien31-Oct-06 15:57
Maximilien31-Oct-06 15:57 
GeneralRe: Si units in C++ Pin
Stephen Hewitt31-Oct-06 16:06
Stephen Hewitt31-Oct-06 16:06 
QuestionWhat will be the algorithm of your program Pin
ch.Asif29-Oct-06 6:10
ch.Asif29-Oct-06 6:10 
AnswerRe: What will be the algorithm of your program Pin
Shog929-Oct-06 6:38
sitebuilderShog929-Oct-06 6:38 
AnswerRe: What will be the algorithm of your program Pin
El Corazon29-Oct-06 12:08
El Corazon29-Oct-06 12:08 
GeneralRe: What will be the algorithm of your program Pin
Just me at will_george...something8-Nov-06 3:13
Just me at will_george...something8-Nov-06 3:13 
AnswerRe: What will be the algorithm of your program Pin
Stathread5-Nov-06 3:48
Stathread5-Nov-06 3:48 
AnswerRe: What will be the algorithm of your program Pin
Just me at will_george...something8-Nov-06 3:19
Just me at will_george...something8-Nov-06 3:19 

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.