Click here to Skip to main content
15,891,828 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: calculate polygon area and its centre in 3d Pin
cp98761-Apr-09 20:10
cp98761-Apr-09 20:10 
QuestionStable Quicksort algorithm Pin
Member 419459331-Mar-09 6:04
Member 419459331-Mar-09 6:04 
AnswerRe: Stable Quicksort algorithm Pin
Lutosław31-Mar-09 12:39
Lutosław31-Mar-09 12:39 
GeneralRe: Stable Quicksort algorithm Pin
Member 419459331-Mar-09 16:06
Member 419459331-Mar-09 16:06 
AnswerRe: Stable Quicksort algorithm Pin
Stephen Hewitt31-Mar-09 17:11
Stephen Hewitt31-Mar-09 17:11 
GeneralRe: Stable Quicksort algorithm Pin
Member 41945931-Apr-09 17:16
Member 41945931-Apr-09 17:16 
GeneralRe: Stable Quicksort algorithm Pin
supercat93-Apr-09 6:22
supercat93-Apr-09 6:22 
GeneralRe: Stable Quicksort algorithm Pin
Member 41945934-Apr-09 5:58
Member 41945934-Apr-09 5:58 
supercat9,

Thank you for the reply. I am aware that it will take more time or storage to stablize the sort. The question is how much more. I am already running into conditions that have sometimes forced me to go to an external sort, not enough virtual memory available. Especially under full memory condition, you do not want to swap by exchanging pointers, you will be paged to death the entire time. At least by scanning up or down in memory for adjacent records, you will stay in a small number of pages (3 to 6) the records in their original positions may result in a page fetch for each record.

If you include a tie-breaker element in the keys, it takes that extra room in each record, space that always must be swapped during exchanges, and sometimes must compared when the rest of the key matches. If the original record has another field that can be used as a tie-breaker, then the extra space and the exchange time already exist, and it is only a matter of comparing the tie-breaker if the rest of the key matches, but, this requires having to specify the parameters of the tie-breaker so the compare can be done and the type of element may not be the same as the original key. All of this is doable, just a matter of what is the "best".

Dave.
AnswerRe: Stable Quicksort algorithm [modified] Pin
bulg3-Apr-09 14:15
bulg3-Apr-09 14:15 
GeneralP.s. Pin
bulg3-Apr-09 14:28
bulg3-Apr-09 14:28 
GeneralRe: Stable Quicksort algorithm Pin
Member 41945934-Apr-09 6:36
Member 41945934-Apr-09 6:36 
GeneralRe: Stable Quicksort algorithm Pin
bulg9-Apr-09 11:42
bulg9-Apr-09 11:42 
GeneralRe: Stable Quicksort algorithm Pin
Member 41945939-Apr-09 16:51
Member 41945939-Apr-09 16:51 
QuestionVector orientation Question. Pin
Maximilien31-Mar-09 4:59
Maximilien31-Mar-09 4:59 
AnswerRe: Vector orientation Question. Pin
Luc Pattyn31-Mar-09 5:06
sitebuilderLuc Pattyn31-Mar-09 5:06 
GeneralRe: Vector orientation Question. Pin
Maximilien31-Mar-09 5:34
Maximilien31-Mar-09 5:34 
GeneralRe: whatever shape Pin
Luc Pattyn31-Mar-09 5:38
sitebuilderLuc Pattyn31-Mar-09 5:38 
GeneralRe: whatever shape Pin
Maximilien31-Mar-09 5:42
Maximilien31-Mar-09 5:42 
AnswerRe: Vector orientation Question. Pin
73Zeppelin31-Mar-09 5:13
73Zeppelin31-Mar-09 5:13 
AnswerRe: Vector orientation Question. Pin
Tim Craig31-Mar-09 8:26
Tim Craig31-Mar-09 8:26 
AnswerRe: Vector orientation Question. Pin
Roger Wright1-Apr-09 20:06
professionalRoger Wright1-Apr-09 20:06 
QuestionHow To Scramble Numbers On These Tables? [modified] Pin
Feranawati31-Mar-09 3:56
Feranawati31-Mar-09 3:56 
AnswerRe: How To Scramble Numbers On These Tables? Pin
Feranawati22-Apr-09 3:03
Feranawati22-Apr-09 3:03 
QuestionNeed help finding an Algorithm for a project [modified]-with image link Pin
dfreeser30-Mar-09 6:34
dfreeser30-Mar-09 6:34 
AnswerRe: Need help finding an Algorithm for a project Pin
Jörgen Andersson30-Mar-09 9:47
professionalJörgen Andersson30-Mar-09 9:47 

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.