A way to define how much time and data a certain code takes

Visual Example:

Why does this method exist?

Because it gives us a simple function of time versus iteration.

Pros: a simple function that describe the efficiency of code. Cons: little hard to create and understand. The use of this method comes handy when creating big data analysis projects, that the efficiency is a main thing.

Time Complexity of big O:


The field of Data Structures is one of the most important fields in computer science. The basic of Data Structures are collection base DS(Data Structure) Collection are containers used to store data in order to access it and use it in the future. Examples for collections are lists arrays dictionary etc.

Lists

In theory a list is a collection of related objects that have with no fixed length.

Array:

A list of elements one after another that have an index (an index is just the number associated with a place in the array).


Binary Search:

Binary Search is an algorithm based on sorted array. The flow of this algorithm is that: you repeatedly dividing in half the portion of the array. And check if the middle element of the initial array is bigger or smaller then your target element. if bigger, do the same to the right (higher) part of the array, if smaller take the left (lower) part of the array. Repeat this operation till you can not continue to split the array in half. here is a visual explanation:

Reem Mikulsky

I’m a 16 years old boy that is interested in the future and technology

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store