Click here to Skip to main content
15,896,201 members

Comments by Aamir Yousafi (Top 16 by date)

Aamir Yousafi 13-Aug-16 15:51pm View    
Yeah, but with such small programs, the running time won't be significant anyway. The profiler will, hopefully, tell me something about the processor operations completed. This will help me analyze which of my algorithms is most efficient, since I cannot rely on the standard math available for each type of algorithm, because I didn't copy - paste that code and implemented quite a bit differently than the standard.
Aamir Yousafi 13-Aug-16 13:19pm View    
It's not only runtime that I need. In fact, when I run the .exe in Windows, I get the execution time in the MS-DOS console.

Yes, I need more details. I'll look into a good profiler.
Aamir Yousafi 13-Aug-16 6:56am View    
So, actually, if you have a way to fix that quicksort function so that it doesn't need to create new arrays, which I was trying to avoid doing, then I would love that. Let me know if you want me to share that code.
Aamir Yousafi 13-Aug-16 6:54am View    
ppolymorphe, yes, you're probably right about the dynamic memory allocation. I'm going to use that from now on for all my arrays whether or not they are linked lists.

Regarding the array / pointer being passed to the function, well, my experience is that if you're passing a pointer, you should pass it as such and when you're passing an array, you pass it as such. I remember getting frustrated with my quicksort algorithm code for recursive calls when I was trying to pass pointers that would work on the arrays because it was crashing. Finally, when I changed all of those pointers to arrays that would be recursively declared and passed to the quicksort function recursively, I got it to work. I can share my quicksort code with you so you know where I'm coming from on this.
Aamir Yousafi 19-Jul-16 13:06pm View    
Thanks. I will incorporate that into my program(s).