A way to define how much time and data a certain code takes
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.
In theory a list is a collection of related objects that have with no fixed length.
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 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:
I’m a 16 years old boy that is interested in the future and technology