Algorithms

What’s an algorithm?

Algorithm is simply a set of instructions implemented to perform a certain task. The word “algorithm” is derived from the name of Al-Khwarizmi and then was Latinized as “Algoritmi”.

Complexities:

Time and Spa…



What’s an algorithm?

Algorithm is simply a set of instructions implemented to perform a certain task. The word “algorithm” is derived from the name of Al-Khwarizmi and then was Latinized as “Algoritmi”.



Complexities:

Time and Space Complexities are so important and the gate to understand the whole concept of an algorithm. Furthermore, calculation of time and space complexity is so essential to reach the optimum solution to many problems.
Technically, complexity is used to measure performance of your algorithm and to know the best approach to solve the problem.
Time complexity: amount of time taken to process the set of instructions in terms of length of input.
Space Complexity: amount of space or memory taken by the set of instructions in terms of length of input.
Big O notation: is the upper bound of an algorithm, and is notated by O().
So, if we want to search for an element in an array, the worst case scenario is to find this element at last index in the array, which means traversing the whole array of length (N), having a time complexity of O(N) and space complexity of O(1) as we didn’t use any extra space.
Big ? notation: big omega is the lower bound of an algorithm, and is notated by ?().
Big ? notation: big theta is tight bound of an algorithm, and is notated by ?().
The most used notation is Big O notation, because it will give us an upper limit of the execution time i.e. the execution time in the worst case.


Print Share Comment Cite Upload Translate
APA
Hagar | Sciencx (2024-03-29T08:08:13+00:00) » Algorithms. Retrieved from https://www.scien.cx/2021/04/19/algorithms/.
MLA
" » Algorithms." Hagar | Sciencx - Monday April 19, 2021, https://www.scien.cx/2021/04/19/algorithms/
HARVARD
Hagar | Sciencx Monday April 19, 2021 » Algorithms., viewed 2024-03-29T08:08:13+00:00,<https://www.scien.cx/2021/04/19/algorithms/>
VANCOUVER
Hagar | Sciencx - » Algorithms. [Internet]. [Accessed 2024-03-29T08:08:13+00:00]. Available from: https://www.scien.cx/2021/04/19/algorithms/
CHICAGO
" » Algorithms." Hagar | Sciencx - Accessed 2024-03-29T08:08:13+00:00. https://www.scien.cx/2021/04/19/algorithms/
IEEE
" » Algorithms." Hagar | Sciencx [Online]. Available: https://www.scien.cx/2021/04/19/algorithms/. [Accessed: 2024-03-29T08:08:13+00:00]
rf:citation
» Algorithms | Hagar | Sciencx | https://www.scien.cx/2021/04/19/algorithms/ | 2024-03-29T08:08:13+00:00
https://github.com/addpipe/simple-recorderjs-demo