Click here to Skip to main content
15,887,214 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Fastest way to count nested loops Pin
Patrice T7-Nov-15 8:16
mvePatrice T7-Nov-15 8:16 
GeneralRe: Fastest way to count nested loops Pin
Member 113783027-Nov-15 8:27
Member 113783027-Nov-15 8:27 
GeneralRe: Fastest way to count nested loops Pin
Patrice T7-Nov-15 8:52
mvePatrice T7-Nov-15 8:52 
GeneralRe: Fastest way to count nested loops Pin
Member 113783027-Nov-15 9:08
Member 113783027-Nov-15 9:08 
GeneralRe: Fastest way to count nested loops Pin
Patrice T7-Nov-15 9:19
mvePatrice T7-Nov-15 9:19 
GeneralRe: Fastest way to count nested loops Pin
harold aptroot7-Nov-15 5:20
harold aptroot7-Nov-15 5:20 
AnswerRe: Fastest way to count nested loops Pin
Luc Pattyn3-Jan-16 6:37
sitebuilderLuc Pattyn3-Jan-16 6:37 
Questionhow do you calculate a primitive operation in algorithm analysis Pin
Member 118975665-Nov-15 21:15
Member 118975665-Nov-15 21:15 
hello everyone... first of all im reading a book about algorithms analysis and im in the topic called counting the primitive operation of an algorithm

and the algorithm is finding the largest element in an array ....

and it comes up to this formula:

the best case is :
2 + 1 + n + 4(n - 1) + 1 = 5n

and the worst case is

2 + 1 + n + 6(n - 1) + 1 = 7n - 2

my question is how does he come up to those answet ? sorry guys im not very good at math.. and im still working on my algebra skills

thanks guys for the help

this.is.the psuecode.that.have been used for the example.in the book

Algorithm arrayMax(A, n):
Currentmax = A[0]

for (i = 1; i < n - 1; i++) do:
If CurrentMax < A[i] do:
CurrentMax = A[i]

return CurrentMax
AnswerRe: how do you calculate a primitive operation in algorithm analysis Pin
Richard Deeming6-Nov-15 2:02
mveRichard Deeming6-Nov-15 2:02 
GeneralRe: how do you calculate a primitive operation in algorithm analysis Pin
Member 118975666-Nov-15 2:57
Member 118975666-Nov-15 2:57 
GeneralRe: how do you calculate a primitive operation in algorithm analysis Pin
Richard Deeming6-Nov-15 3:03
mveRichard Deeming6-Nov-15 3:03 
GeneralRe: how do you calculate a primitive operation in algorithm analysis Pin
jschell7-Nov-15 6:18
jschell7-Nov-15 6:18 
QuestionBinary Polynomial Multiplication Pin
Member 120276965-Nov-15 2:04
Member 120276965-Nov-15 2:04 
GeneralRe: Binary Polynomial Multiplication Pin
harold aptroot5-Nov-15 3:40
harold aptroot5-Nov-15 3:40 
GeneralRe: Binary Polynomial Multiplication Pin
Member 120276965-Nov-15 20:19
Member 120276965-Nov-15 20:19 
GeneralRe: Binary Polynomial Multiplication Pin
Patrice T5-Nov-15 17:24
mvePatrice T5-Nov-15 17:24 
Questionneed help with number base conversion algorithm for computers Pin
mickcs4-Nov-15 10:14
mickcs4-Nov-15 10:14 
AnswerRe: need help with number base conversion algorithm for computers Pin
Richard Andrew x644-Nov-15 10:36
professionalRichard Andrew x644-Nov-15 10:36 
AnswerRe: need help with number base conversion algorithm for computers Pin
Patrice T4-Nov-15 14:55
mvePatrice T4-Nov-15 14:55 
QuestionFeistel Cipher Algorithm: Problems aim to solve Pin
Ka Mal31-Oct-15 15:07
Ka Mal31-Oct-15 15:07 
AnswerRe: Feistel Cipher Algorithm: Problems aim to solve Pin
Richard MacCutchan31-Oct-15 21:41
mveRichard MacCutchan31-Oct-15 21:41 
GeneralRe: Feistel Cipher Algorithm: Problems aim to solve Pin
Richard Deeming2-Nov-15 1:50
mveRichard Deeming2-Nov-15 1:50 
GeneralRe: Feistel Cipher Algorithm: Problems aim to solve Pin
Richard MacCutchan2-Nov-15 1:59
mveRichard MacCutchan2-Nov-15 1:59 
Questionanalysis of boolean table to optimize code ? Pin
BillWoodruff30-Oct-15 22:59
professionalBillWoodruff30-Oct-15 22:59 
AnswerRe: analysis of boolean table to optimize code ? Pin
Gerry Schmitz3-Nov-15 8:28
mveGerry Schmitz3-Nov-15 8:28 

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.