Date: Tue, 20 Jan 1998 19:08:42 -0600 (CST) From: Andrew Deren To: Gili cc: djgpp AT delorie DOT com Subject: Re: The meaning of O(n)... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 20 Jan 1998, Gili wrote: > Hi, > > I have noticed that lots algorithms provide their efficency as O(n), > where N is the number of elements they are operating on. The last math > course I have taken is Calculus 2 and I do not recall ever seeing the > O(n) function. What does it mean? How efficient is something with > O(n)? Thanks in advanced, O(n) is what computer scienties use to define the running time or an algorithm. You'd probably never hear it in math class but you should if you take any CS course . Basically what it means is how many times the algorithm has to execute some body of a program. Let's say you have a loop that goes through all elements of the array it's complexity is O(n) where n is number of elemnts of the array. > > Gili >