Click here to Skip to main content
16,016,067 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Fixed Point vs. Floating Point Pin
Stuart Dootson11-Sep-07 22:56
professionalStuart Dootson11-Sep-07 22:56 
Questionalgorithm help!?! Pin
marvc17-Sep-07 6:11
marvc17-Sep-07 6:11 
AnswerRe: algorithm help!?! Pin
Luc Pattyn7-Sep-07 6:56
sitebuilderLuc Pattyn7-Sep-07 6:56 
GeneralRe: algorithm help!?! Pin
Dan Neely7-Sep-07 10:17
Dan Neely7-Sep-07 10:17 
GeneralRe: algorithm help!?! Pin
Luc Pattyn7-Sep-07 10:50
sitebuilderLuc Pattyn7-Sep-07 10:50 
GeneralRe: algorithm help!?! Pin
Daniel Grunwald7-Sep-07 11:42
Daniel Grunwald7-Sep-07 11:42 
GeneralRe: algorithm help!?! Pin
Luc Pattyn7-Sep-07 12:15
sitebuilderLuc Pattyn7-Sep-07 12:15 
AnswerRe: algorithm help!?! Pin
Russell'8-Sep-07 0:22
Russell'8-Sep-07 0:22 
At others replyed you can sort the array and then extraxt the maxs, this in 2 step. But the faster way depends probally on the length of your data array and on the number of extractions: in your case this numbers are 15 and 5, I think that you can fastly sort the array, so then it is probally a good idea to do this. But in the case of 100 and 3 probally you can find a faster way without sort the array and find directly the greather 3 numbers.
So, I want only to tell you a different way to solve this:
1) find the min value (minV)
2) find the max value and its index (maxV1, idxV1) then save it somewhere
3) replace maxV1 with minV in the original array
4) find the max value, so: maxV2 and idxV2, then store maxV2 somewhere and replace it with minV in the array
5) do this again and again...5 times

Probally this way can be faster on longer array (like 100) because in this way you have to read data from the array less times then to sort it


Russell

QuestionMagic squares in matlab Pin
Rami Y.5-Sep-07 17:19
Rami Y.5-Sep-07 17:19 
AnswerRe: Magic squares in matlab Pin
Russell'5-Sep-07 22:26
Russell'5-Sep-07 22:26 
QuestionFRACTAL FORMULAS Pin
cyndy_northrup4-Sep-07 21:50
cyndy_northrup4-Sep-07 21:50 
AnswerRe: FRACTAL FORMULAS Pin
Russell'4-Sep-07 22:57
Russell'4-Sep-07 22:57 
GeneralRe: FRACTAL FORMULAS Pin
cyndy_northrup5-Sep-07 15:10
cyndy_northrup5-Sep-07 15:10 
GeneralRe: FRACTAL FORMULAS Pin
Russell'5-Sep-07 22:09
Russell'5-Sep-07 22:09 
AnswerRe: FRACTAL FORMULAS Pin
Luc Pattyn4-Sep-07 23:06
sitebuilderLuc Pattyn4-Sep-07 23:06 
Questioncontiguous bits algorithm. Pin
chandu0042-Sep-07 22:09
chandu0042-Sep-07 22:09 
AnswerRe: contiguous bits algorithm. Pin
Russell'2-Sep-07 22:44
Russell'2-Sep-07 22:44 
AnswerRe: contiguous bits algorithm. Pin
cp98762-Sep-07 22:48
cp98762-Sep-07 22:48 
GeneralRe: contiguous bits algorithm. Pin
chandu0042-Sep-07 23:14
chandu0042-Sep-07 23:14 
GeneralRe: contiguous bits algorithm. [modified] Pin
cp98763-Sep-07 0:04
cp98763-Sep-07 0:04 
GeneralRe: contiguous bits algorithm. Pin
Russell'3-Sep-07 1:09
Russell'3-Sep-07 1:09 
GeneralRe: contiguous bits algorithm. Pin
Russell'3-Sep-07 0:26
Russell'3-Sep-07 0:26 
AnswerRe: contiguous bits algorithm. Pin
rihdus3-Sep-07 2:06
rihdus3-Sep-07 2:06 
AnswerRe: contiguous bits algorithm. Pin
Luc Pattyn3-Sep-07 5:37
sitebuilderLuc Pattyn3-Sep-07 5:37 
GeneralRe: contiguous bits algorithm. Pin
Russell'3-Sep-07 5:46
Russell'3-Sep-07 5:46 

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.