List and Describe search algorithms (2)
Extra info:
For list of n elements: find middle by using ceiling of (n-1)/2.
Ceiling means that if number from equation is not an integer choose the next larger integer. Example: if 2.3 then choose 3
So if you have 4 elements in your list you will get 1.5 then 2 from equation. First element of list is always 0. So you will compare against the 3rd element.
Linear search: performance
Binary search: performance
What is Intermezzo?
Graph representing the time complexity (big O) of algorithms in order to compare their performance (how much time, memory, disk etc.)
Used to classify algorithms.
Comparison according to rates of growth.
Useful: analyzing efficiency