Click here to Skip to main content
15,886,689 members
Home / Discussions / Algorithms
   

Algorithms

 
SuggestionRe: Minimal covering ring Pin
Kornfeld Eliyahu Peter14-Jun-16 6:12
professionalKornfeld Eliyahu Peter14-Jun-16 6:12 
GeneralRe: Minimal covering ring Pin
harold aptroot30-Jun-16 3:03
harold aptroot30-Jun-16 3:03 
QuestionTricky algorithm i cant solve.. ||thank you in advence Pin
sPPa2-Jun-16 10:44
sPPa2-Jun-16 10:44 
AnswerRe: Tricky algorithm i cant solve.. ||thank you in advence Pin
Henry Faure4-Jul-16 9:25
Henry Faure4-Jul-16 9:25 
QuestionWhat Does Complexity of Algorithm Mean??? Pin
Django_Untaken26-May-16 1:09
Django_Untaken26-May-16 1:09 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
Rob Philpott26-May-16 1:27
Rob Philpott26-May-16 1:27 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
Richard MacCutchan26-May-16 1:34
mveRichard MacCutchan26-May-16 1:34 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
harold aptroot26-May-16 1:35
harold aptroot26-May-16 1:35 
Just look up the definition.

f(n) ∈ O(g(n)) iff there exists an n0 and c such that for all n > n0, f(n) < c g(n)

This quite technical definition means the whole big O deal is really a statement about membership of a function in some set of functions that, informally, all "grow about the same". But they only have to start growing about the same after some point n0 (which you don't know) and an arbitrary constant is hidden.

For time complexity that function we make statements about is the function that counts how many "elementary operations" some algorithm takes a function of the size of its input. In order to do that, one must agree about what kind of operations are elementary. There are several models for that, the "usual one" has the at first sight odd property that mathematical operations on integers of size O(log n) run in constant time. This is necessary to prevent the following problem: suppose you could only do operations on constant-length integers in constant time, and you want to manipulate an index into an array. That array has length n, so the index must have size (you guessed it) log n. It would therefore take non-constant space to even just have an index, and non-constant time to do anything with an index, which usually no one wants.

It should be clear from the n0 that big O notation explicitly says nothing about the behaviour of the function at any particular constant. It also says nothing about what happens when you double that constant, a mistake that is commonly made, leading to questions such as "it took x milliseconds for an input of size 10, how long will it take for an input of size 20" - you cannot know based on some big O.
Django_Untaken wrote:
Let us suppose a simple array contains 25 elements
So it should be clear by now that you can't say much about that situation. Bubble sort (and literally anything else) is going to take some constant number of elementary operations (aka "time") on that input, because there is no variable to vary. You cannot compute the number of operations based on the big O (but based on detailed knowledge of the algorithm, you can).
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
Patrice T28-May-16 9:55
mvePatrice T28-May-16 9:55 
SuggestionRe: What Does Complexity of Algorithm Mean??? Pin
Richard Deeming1-Jun-16 1:24
mveRichard Deeming1-Jun-16 1:24 
GeneralRe: What Does Complexity of Algorithm Mean??? Pin
Patrice T1-Jun-16 1:45
mvePatrice T1-Jun-16 1:45 
QuestionHow they got this function? Pin
Member 125085107-May-16 1:51
Member 125085107-May-16 1:51 
AnswerRe: How they got this function? Pin
Chris Losinger12-May-16 6:33
professionalChris Losinger12-May-16 6:33 
QuestionIn Search for a Published Board Game Generating Algorithm Pin
Mark.io5-May-16 2:13
Mark.io5-May-16 2:13 
QuestionAlgorithm Pin
Member 1246448116-Apr-16 5:43
Member 1246448116-Apr-16 5:43 
AnswerRe: Algorithm Pin
Richard Deeming18-Apr-16 2:28
mveRichard Deeming18-Apr-16 2:28 
GeneralRe: Algorithm Pin
honglomong940@gmail.com29-Apr-16 22:50
honglomong940@gmail.com29-Apr-16 22:50 
AnswerRe: Algorithm Pin
Patrice T18-Apr-16 5:46
mvePatrice T18-Apr-16 5:46 
QuestionDealing with arbitrarily large power of 10 numbers Pin
Member 1168325115-Apr-16 3:52
Member 1168325115-Apr-16 3:52 
SuggestionRe: Dealing with arbitrarily large power of 10 numbers Pin
Richard Deeming15-Apr-16 4:21
mveRichard Deeming15-Apr-16 4:21 
GeneralRe: Dealing with arbitrarily large power of 10 numbers Pin
Member 1168325115-Apr-16 8:45
Member 1168325115-Apr-16 8:45 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Eddy Vluggen15-Apr-16 5:00
professionalEddy Vluggen15-Apr-16 5:00 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Kenneth Haugland15-Apr-16 14:43
mvaKenneth Haugland15-Apr-16 14:43 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Mark.io5-May-16 1:56
Mark.io5-May-16 1:56 
GeneralRe: Dealing with arbitrarily large power of 10 numbers Pin
Member 116832518-May-16 22:15
Member 116832518-May-16 22:15 

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.