1

this is my first question on this site and I would like to preface this by saying I am not very savvy when it comes to Computer Science. So, I will try to ask this the best I can.

I was doing some research on Polynomial time because that is what I was told hashing algorithms run on, correct me if I am wrong. So with that I read that for every input n there a running time of n^k. Is that correct? If so how do I know what k is. I know it is a constant, but how do I know what it is for a given algorithm? Also, is running time just the outputs of n^k?

Thanks and sorry if this was poorly written, I am just trying to learn about crypto and some of this stuff on my own.

Joe
  • 51
  • 3
  • 1
    For different algorithms there may be a different $k$. For example, a trivial algorithm always printing "THIS IS SPARTA" and nothing else, will take $O(1)=O(n^0)$. But a matrix multiplication algorithm will take $O(n^3)$ (or a bit less if you are using exotic algorithms) – nir shahar Apr 06 '22 at 21:02
  • https://cs.stackexchange.com/q/13625/755, https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time – D.W. Apr 06 '22 at 21:35
  • @nirshahar Alright but what about for hashing algorithms which run in polynomial time how is it decided what the k will be? Is it something that is decided when creating the algorithm based off what the creators are trying to get out of the algorithm? – Joe Apr 07 '22 at 22:23
  • @Joe While your questions are good, they do not fit very well this site, which is designed for a specific question that is answerable with no or little interaction. It looks like you should read one or more tutorials on big $O$-notation and then one or more tutorial on polynomial-time first. – John L. Apr 23 '22 at 16:09

0 Answers0