The Big O Notion Time and Space Concept In Computer Science

feature-top

The software engineering programming work field is really interesting, a software engineer though must be prepared to answer any kind of programming questions, using their programming language of choice, if he/she expects to be hired by a top programming company.

In today's article, we are going to be talking about the Big O Notation time and space in computer science.

The techniques and resources available to software engineers can help them find solutions, for any kind of complex problems. Landau's symbol or Big O notation is used to tell how fast a function grows or decline, in complexity theory, computer science, and mathematics.

The rate of growth of a function is also known as its order, therefore the letter O is used, as the symbol for Big O time and space. The asymptotic behavior of functions is described by the Big O time and space, which is also used in computer science particularly to describe the performance or complexity of an algorithm.

The Big O notation ranks an algorithms' efficiency, by using O as the order of the function or its growth rate, and n is the length of the array that is being sorted. Therefore we can use O(n) or O(n2) to express the run-time of algorithms.

A function that runs or requires just one step, would be expressed as O(1), the input array could be 1 or 1000 items, one step would still be the run time. The performance of an algorithm may grow linearly and in direct proportion to the size of the input data set, therefore, the O(n) would be used to describe the efficiency of such functions.

In Big O notation, there are three different types of time complexities known as O(1) – constant time complexity, O(n) – linear time complexity, O(log n) – logarithmic time complexity and O(n2) – quadratic time complexity.

When an algorithm has nested iterations over a data set, then the O(n2) notation can be used, describe its run-time.

Accessing a value with an array index in PHP is a good example of an O(1) run time.

For example


var arr = [ 1,2,3,4,5];

arr[2]; // => 3
 
Another type of time complexity in Big O notation is O(n!), which means that the execution time of the function, runs as the same rate as that of the factorial of the parameter n.
Big O notation considers time, space and problems with data sizes. Different types of performance analysis such as best case, average case and worst-case analysis, are used to analyze the programming code performance. 
When the behavior of an algorithm is under optimal conditions, then it is said to be best case analysis of the algorithm. When an algorithm performs worst for a given input, and does not solve the problem, then it is said that the algorithm has a work-case performance. 
When an average optimal algorithm is used to solve a problem, then it is said that the algorithm had an average performance, which was the performance analysis of that algorithm. 
One thing to note about Big O notation is that the input can be many things, such as an array, linked list, or nodes in a tree. 

Thank you for reading this article!!!
    
       
    
feature-top
feature-top
Hernando Cadet

Hi every one, I obtained a bachelor's degree in Bioinformatics back in 2006, from Claflin University, after I received my bachelor's degree, I gained full time employment as a software engineer at a Video Relay Service company, maintaining databases and developing software for a new developed device called the VPAD.

I worked at that company for two years, then I became a web developer, and worked for a magazine for three years. After that job, I worked as a Drupal web developer, as a subcontractor for the NIH, for a year and then left the job to go back to school.

Hernando Cadet Hi every one, I obtained a bachelor's degree in Bioinformatics back in 2006, from Claflin University, after I received my bachelor's degree, I gained full time employment as a software engineer at a Video Relay Service company, maintaining databases and developing software for a new developed device called the VPAD.

I worked at that company for two years, then I became a web developer, and worked for a magazine for three years. After that job, I worked as a Drupal web developer, as a subcontractor for the NIH, for a year and then left the job to go back to school.