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

Algorithms

 
GeneralRe: row major and column major order Pin
Sadaiyappan8-Apr-09 11:51
Sadaiyappan8-Apr-09 11:51 
GeneralRe: row major and column major order Pin
Luc Pattyn8-Apr-09 12:34
sitebuilderLuc Pattyn8-Apr-09 12:34 
QuestionBest coding practice. Pin
Member 41945936-Apr-09 18:08
Member 41945936-Apr-09 18:08 
AnswerRe: Best coding practice. [modified] Pin
Luc Pattyn7-Apr-09 4:27
sitebuilderLuc Pattyn7-Apr-09 4:27 
GeneralRe: Best coding practice. Pin
Member 41945937-Apr-09 14:40
Member 41945937-Apr-09 14:40 
GeneralRe: Best coding practice. Pin
Luc Pattyn7-Apr-09 15:21
sitebuilderLuc Pattyn7-Apr-09 15:21 
GeneralRe: Best coding practice. Pin
Member 41945937-Apr-09 16:23
Member 41945937-Apr-09 16:23 
GeneralRe: Best coding practice. Pin
Member 419459310-Apr-09 19:55
Member 419459310-Apr-09 19:55 
Luc,

I have completed development on my Quicksort. The following is the timing for the sort using just an array of DWORDS. The rest of the tests work as planed, ascending/descending, signed/unsigned, big-endian/little-endian, two different sort keys allowed, BYTES/WORDS/DWORDS/Floats/Doubles/extended_floating, BYTE or WORD null terminated strings, up to 2048 elements per key, fully automated test and tracing environment to verify results.

Do you have a feel for what a good timing benchmark might be for this size of a sort?

The following timings are only for the actual sorting, not the setup. The data
is prepared, start time taken, sorted, end time taken, time difference is
accumulated, loop back 1023 more times.

The random data originally was created by randomly selecting a number from the
set, saving the number, shrinking the set, and recalculating a new random number
on a decremented range. This was taking too long to shrink up a 1024*1024 DWORD
buffer for each extraction. The method was changed to just create a random
number in the range of 0 to ((1024*1024)-1), save the random number, decrement
the range, and calculate another random number for the decremented range. Since
there are potentially many duplicates, and probably not all numbers are present,
the checking was changed from comparing the sorted array against a known
ascending or descending array, to individually comparing each DWORD pair
(comparing element n to element n+1) and verifying that it is not above (if an
ascending sort) or not below (if a descending sort).

Note: The sort completed with only a 4096 byte stack, sorting 1024*1024 DWORDS.

Building Ascending data.
Building Descending data.
1024*1024 Ascending DWORDS sorted 1024 times Ascending, time in msec:   37144, good compare. 36.27 msec/iteration.
1024*1024 Ascending DWORDS sorted 1024 times Descending, time in msec:  46130, good compare. 45.05 msec/iteration.
1024*1024 Descending DWORDS sorted 1024 times Ascending, time in msec:  47689, good compare. 45.57 msec/iteration.
1024*1024 Descending DWORDS sorted 1024 times Descending, time in msec: 53870, good compare. 52.61 msec/iteration.
Building Random data.
1024*1024 Random DWORDS sorted 1024 times Ascending, time in msec:      158389, good compare. 154.67 msec/iteration.
1024*1024 Random DWORDS sorted 1024 times Descending, time in msec:     141898, good compare. 138.57 msec/iteration.


I do have code samples (.LST output) if you are interested.

Dave.
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 0:39
Luc 64801111-Apr-09 0:39 
GeneralRe: Best coding practice. Pin
Member 419459311-Apr-09 5:51
Member 419459311-Apr-09 5:51 
GeneralRe: Best coding practice. Pin
Luc 64801111-Apr-09 6:18
Luc 64801111-Apr-09 6:18 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 8:29
Member 419459315-Apr-09 8:29 
GeneralRe: Best coding practice. Pin
Luc 64801115-Apr-09 8:39
Luc 64801115-Apr-09 8:39 
GeneralRe: Best coding practice. Pin
Member 419459315-Apr-09 9:45
Member 419459315-Apr-09 9:45 
QuestionRotation of Bitmap Pin
CodeOfLife5-Apr-09 16:21
CodeOfLife5-Apr-09 16:21 
AnswerRe: Rotation of Bitmap [modified] Pin
Luc Pattyn5-Apr-09 16:30
sitebuilderLuc Pattyn5-Apr-09 16:30 
GeneralRe: Rotation of Bitmap Pin
CodeOfLife6-Apr-09 6:37
CodeOfLife6-Apr-09 6:37 
GeneralRe: Rotation of Bitmap Pin
Luc Pattyn6-Apr-09 6:59
sitebuilderLuc Pattyn6-Apr-09 6:59 
QuestionCreating RSOM from SOM Pin
Jasmine Pomelo4-Apr-09 14:04
Jasmine Pomelo4-Apr-09 14:04 
QuestionRe: Creating RSOM from SOM Pin
CPallini6-Apr-09 21:39
mveCPallini6-Apr-09 21:39 
AnswerRe: Creating RSOM from SOM Pin
Jasmine Pomelo9-Apr-09 9:38
Jasmine Pomelo9-Apr-09 9:38 
QuestionSingle Elimination - Tournament Brackets Pin
aslamc2-Apr-09 9:32
aslamc2-Apr-09 9:32 
AnswerRe: Single Elimination - Tournament Brackets Pin
Alan Balkany3-Apr-09 4:00
Alan Balkany3-Apr-09 4:00 
QuestionTree algo Pin
dfreeser2-Apr-09 5:58
dfreeser2-Apr-09 5:58 
AnswerRe: Tree algo Pin
Alan Balkany3-Apr-09 3:43
Alan Balkany3-Apr-09 3:43 

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.