algorithms Flashcards
2 things to check when developing an algorithm
time complexity
space complexity
what is time complexity
how much it takes to solve a particular problem
what is time complexity measured in
using big-o notation
what does big o notation show
the effectiveness of an algorithm
show the time taken relative to the number of data elements given as an input
what is the benefit of big O notation
allows to predict the amount of time it takes for an algorithm to finish the given number of elements
define liner search algorithm
an algorithm that looks through every item one at a time until it finds the item its searching for
big o notation for linear search algorithm is
0 (n)
what is binary search algorithm
a divide and conquer algorithm, this means it splits the list into smaller lists until it finds the item its searching for
big o notation for binary search
0 ((log(n)
what is a bubble sort algorithm
Algorithm that passes through the list evaluating pairs of items and ensuring the larger value is above the smaller value
big o notation for bubble sort 0(n^2)
0(n^2)
big o notation for bubble sort 0(n^2)
0(n^2)
what is an algorithm,
a series of steps taken to complete a task
what is space complexity
the space complicity of an algorithm is the amount oof storage the algorithm takes (keep in sotairage is expensive )
big o notation for space complexity
(O(n))