I need to show the Big O Notation for KNN algorithm. So I wanted to know
- the complexity of brute force KNN algorithm; and
- to make the graph do we have x-axis: input size, y-axis: the speed.
I need to show the Big O Notation for KNN algorithm. So I wanted to know
This seems to be a self-study question, so let me give you few hints.
for
loop, than the loop alone is $O(n)$ since you need to do something for each of the $n$ cases. All the other steps would increase the complexity. If you want a spoiler, here's an exact answer about $k$-NN.